Breaking changes from previous Syncplify Server!' versions
This page outlines the significant changes ("breaking changes") introduced in the latest version of the software, as compared to previous versions. It also provides guidance on how to smoothly adapt to these changes when upgrading to the version described in the current documentation.
GetCurrentVFS() is no longer a member of the Session object
In previous versions of Syncplify Server!, to work with the currently active Virtual File System (VFS) from inside a SyncJS script, you'd call:
var currVfs = Session.GetCurrentVFS();
if (currVfs != null) {
// do something with it
}In Syncplify Server! V7 GetCurrentVFS() has become a stand-alone function, and is no longer a member of the Session object. You will then need to update all of your scripts using this method, in order to call it like this:
var currVfs = GetCurrentVFS();
if (currVfs != null) {
// do something with it
}Read more about this method here.
VFS' ImportFile() and ExportFile() function signature differences
In previous versions of Syncplify Server! the ImportFile() and ExportFile() methods of a VFS object would take a file path and a directory path as arguments, which lead to all kinds of confusion. These functions signatures have now been uniformed as follows:
function ImportFile(localFilePath, targetVfsFilePath: string) respBase;
function ExportFile(vfsFilePath, localFilePath: string) respBase;Read more on this topic on the specific manual pages for ImportFile and ExportFile.
CtxRelPath() replaces Session.GetRelPath() / Session.GetAbsPath() in event-handler scripts
In Syncplify Server! versions 1 through 6, the only way to retrieve the path of the file associated with a triggered event from inside a script was to call Session.GetRelPath() or Session.GetAbsPath(). This was always subtly unreliable: those methods return the session's live path cursor, which may have already changed by the time the script executes — because the client keeps working concurrently.
Syncplify Server! V7 introduces the dedicated CtxRelPath() helper function. The path is captured at the moment the event fires and frozen into the script's execution context for its entire lifetime, regardless of what the client does afterwards.
If you have existing scripts that call Session.GetRelPath() or Session.GetAbsPath() in order to determine which file triggered a file-based event, you should update them to use CtxRelPath() instead:
// Before (V1–V6) — unreliable under concurrent session activity:
var path = Session.GetRelPath();
// After (V7+) — always correct:
var path = CtxRelPath();NOTE
Session.GetRelPath() and Session.GetAbsPath() still exist and are still valid for their original purpose (inspecting the session's current cursor position). Only use them when you genuinely need that live cursor, not when you need the file that triggered the script.
