Skip to content

Commit

Permalink
24.4.6 release
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjgraph committed May 22, 2024
1 parent f883896 commit d575ea7
Show file tree
Hide file tree
Showing 21 changed files with 5,729 additions and 5,717 deletions.
15 changes: 15 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
22-MAY-2024: 24.4.6

- Fixes possible NPE in Graph.initTouch

22-MAY-2024: 24.4.5

- Updates Teams app to use SDK v2.22.0 [CSP-3150]
- Fixes in-place editing on iOS [drawio-4411]
- Updates DOMPurify from 3.1.3 to 3.1.4
- Fixes possible overwritten library files in browser storage
- Blocks popup menu and shape picker in freehand mode
- Fixes units for table cell size change [drawio-4360]
- Fixes handling of parallel edges in explore plugin [drawio-4422]
- Adds units for custom page size [DID-11607]

17-MAY-2024: 24.4.4

- Improves diff sync for removed default layer
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ As well as running this project, we run a production-grade deployment of the dia
License
-----------------

The source code authored by us in this repo is licensed under the Apache v2. The full core is open source, but the are some boundary functions that are difficult to publish in a way we can maintain them.
The source code authored by us in this repo is licensed under the Apache v2. The full core is open source, but there are some boundary functions that are difficult to publish in a way we can maintain them.

The JGraph provided icons and diagram templates are licensed under the [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). Additional terms may also apply where the icons are originally defined by a third-party copyright holder. We have checked in all cases that the original license allows use in this project. Also see the terms for using the draw.io logo below.

Additional minified JavaScript files and Java libraries are used in this project. All of the licenses are deemed compatible with the Apache 2.0, nothing is GPL or AGPL, due dilgence is performed on all third-party code.
Additional minified JavaScript files and Java libraries are used in this project. All of the licenses are deemed compatible with the Apache 2.0, nothing is GPL or AGPL, due diligence is performed on all third-party code.

We make no copyright claim on the content you create with this software, regardless of the copyright of individual icons used in such content.

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
24.4.4
24.4.6
2 changes: 1 addition & 1 deletion etc/dependencies/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"mermaid": "10.0.2",
"pako": "2.1.0",
"crypto-js": "3.1.2",
"dompurify": "3.1.3",
"dompurify": "3.1.4",
"spin.js": "2.0.0",
"roughjs": "4.6.6",
"mathjax": "3.2.2",
Expand Down
20 changes: 3 additions & 17 deletions src/main/webapp/js/diagramly/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -4447,26 +4447,12 @@ App.prototype.saveLibrary = function(name, images, file, mode, noSpin, noReload,
}
else if (mode == App.MODE_BROWSER)
{
var fn = mxUtils.bind(this, function()
{
var file = new StorageLibrary(this, xml, name);

// Inserts data into local storage
file.saveFile(name, false, mxUtils.bind(this, function()
StorageFile.doInsertFile(new StorageLibrary(this, xml, name),
mxUtils.bind(this, function(file)
{
this.hideDialog(true);
this.libraryLoaded(file, images);
}), error);
});

if (localStorage.getItem(name) == null)
{
fn();
}
else
{
this.confirm(mxResources.get('replaceIt', [name]), fn);
}
}), error)
}
else
{
Expand Down
246 changes: 82 additions & 164 deletions src/main/webapp/js/diagramly/DrawioFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,6 @@ DrawioFile.prototype.inConflictState = false;
*/
DrawioFile.prototype.invalidChecksum = false;

/**
* Specifies if error reports should be sent.
*/
DrawioFile.prototype.errorReportsEnabled = false;

/**
* Specifies if stats should be sent.
*/
Expand Down Expand Up @@ -393,23 +388,7 @@ DrawioFile.prototype.mergeFile = function(file, success, error, diffShadow, imme

if (checksum != null && checksum != current)
{
var details = null;

if (this.errorReportsEnabled)
{
var fileData = this.compressReportData(this.getAnonymizedXmlForPages(pages));
var data = this.compressReportData(this.getAnonymizedXmlForPages(patched));
var from = this.ui.hashValue(file.getCurrentEtag());
var to = this.ui.hashValue(this.getCurrentEtag());

details = 'Shadow Details: ' + JSON.stringify(patchedDetails) +
'\nChecksum: ' + checksum + '\nCurrent: ' + current +
'\nCurrent Details: ' + JSON.stringify(currentDetails) +
'\nFrom: ' + from + '\nTo: ' + to + '\n\nFile Data:\n' +
fileData + '\nPatched Shadow:\n' + data;
}

this.checksumError(error, patches, details, null, 'mergeFile',
this.checksumError(error, patches, null, null, 'mergeFile',
checksum, current, file.getCurrentRevisionId());

// Abnormal termination
Expand Down Expand Up @@ -462,19 +441,12 @@ DrawioFile.prototype.mergeFile = function(file, success, error, diffShadow, imme
{
if (reportError)
{
if (this.errorReportsEnabled)
{
this.sendErrorReport('Error in mergeFile', null, e);
}
else
{
var user = this.getCurrentUser();
var uid = (user != null) ? user.id : 'unknown';

EditorUi.logError('Error in mergeFile', null,
this.getMode() + '.' + this.getId(),
uid, e);
}
var user = this.getCurrentUser();
var uid = (user != null) ? user.id : 'unknown';

EditorUi.logError('Error in mergeFile', null,
this.getMode() + '.' + this.getId(),
uid, e);
}
}
catch (e2)
Expand Down Expand Up @@ -588,147 +560,100 @@ DrawioFile.prototype.checksumError = function(fn, patches, details, etag, functi

try
{
if (this.errorReportsEnabled)
var user = this.getCurrentUser();
var uid = (user != null) ? user.id : 'unknown';
var id = (this.getId() != '') ? this.getId() :
('(' + this.ui.hashValue(this.getTitle()) + ')');
var bytes = JSON.stringify(patches).length;
var limit = 1000;
var data = null;

if (patches != null && bytes < limit)
{
if (patches != null)
for (var i = 0; i < patches.length; i++)
{
for (var i = 0; i < patches.length; i++)
{
this.ui.anonymizePatch(patches[i]);
}
this.ui.anonymizePatch(patches[i]);
}

var fn = mxUtils.bind(this, function(file)
{
var json = this.compressReportData(
JSON.stringify(patches, null, 2));
var remote = (file == null) ? 'n/a' :
this.compressReportData(
this.getAnonymizedXmlForPages(
this.ui.getPagesForXml(file.data)),
25000);

this.sendErrorReport('Checksum Error in ' + functionName + ' ' + this.getHash(),
((details != null) ? (details) : '') + '\n\nPatches:\n' + json +
((remote != null) ? ('\n\nRemote:\n' + remote) : ''), null, 70000);
});

if (etag == null)
data = JSON.stringify(patches);

if (data != null && data.length < limit)
{
fn(null);
data = Graph.compress(data);
}
else
{
this.getLatestVersion(mxUtils.bind(this, function(file)
{
if (file != null && file.getCurrentEtag() == etag)
{
fn(file);
}
else
{
fn(null);
}
}), function() {});
data = null;
}
}
else
{
var user = this.getCurrentUser();
var uid = (user != null) ? user.id : 'unknown';
var id = (this.getId() != '') ? this.getId() :
('(' + this.ui.hashValue(this.getTitle()) + ')');
var bytes = JSON.stringify(patches).length;
var limit = 1000;
var data = null;

if (patches != null && bytes < limit)
{
for (var i = 0; i < patches.length; i++)
{
this.ui.anonymizePatch(patches[i]);
}

data = JSON.stringify(patches);

if (data != null && data.length < limit)
{
data = Graph.compress(data);
}
else
{
data = null;
}
}

this.getLatestVersion(mxUtils.bind(this, function(latestFile)
{
// Logs checksum error for file
this.getLatestVersion(mxUtils.bind(this, function(latestFile)
{
// Logs checksum error for file
try
{
var type = (data != null) ? 'report' : 'error';
var latest = this.ui.getHashValueForPages(latestFile.getShadowPages());
var latestVersion = 'unknown';
var latestAgent = 'unknown';
var latestType = 'unknown';

try
{
var type = (data != null) ? 'report' : 'error';
var latest = this.ui.getHashValueForPages(latestFile.getShadowPages());
var latestVersion = 'unknown';
var latestAgent = 'unknown';
var latestType = 'unknown';
var node = (latestFile.initialData != null && latestFile.initialData.length > 0) ?
mxUtils.parseXml(latestFile.initialData).documentElement : null;

try
if (node != null)
{
var node = (latestFile.initialData != null && latestFile.initialData.length > 0) ?
mxUtils.parseXml(latestFile.initialData).documentElement : null;

if (node != null)
if (node.getAttribute('version') != null)
{
if (node.getAttribute('version') != null)
{
latestVersion = node.getAttribute('version');
}
latestVersion = node.getAttribute('version');
}

if (node.getAttribute('agent') != null)
{
latestAgent = node.getAttribute('agent');
}
if (node.getAttribute('agent') != null)
{
latestAgent = node.getAttribute('agent');
}

if (node.getAttribute('type') != null)
{
latestType = node.getAttribute('type');
}
if (node.getAttribute('type') != null)
{
latestType = node.getAttribute('type');
}
}
catch (e)
{
// ignore
}

EditorUi.logError('Checksum ' + type + ' in ' + functionName,
null, this.getMode() + '.' + id,
'user_' + uid + ((this.sync != null) ?
'-client_' + this.sync.clientId : '-nosync') +
'-bytes_' + bytes + '-patches_' + patches.length +
((data != null) ? ('-json_' + data) : '') +
'-size_' + this.getSize() +
((checksum != null) ? ('-expected_' + checksum) : '') +
((current != null) ? ('-current_' + current) : '') +
((rev != null) ? ('-rev_' + this.ui.hashValue(rev)) : '') +
((latest != null) ? ('-latest_' + latest) : '') +
'-latestRev_' + this.ui.hashValue(
latestFile.getCurrentRevisionId()) +
('-latestVersion_' + latestVersion) +
('-latestAgent_' + latestAgent) +
('-latestType_' + latestType));

EditorUi.logEvent({category: 'CHECKSUM-ERROR-SYNC-FILE-' + id,
action: functionName, label: 'user_' + uid + ((this.sync != null) ?
'-client_' + this.sync.clientId : '-nosync') +
'-bytes_' + bytes + '-patches_' + patches.length +
'-size_' + this.getSize()});
}
catch (e)
{
// ignore
}
}), function() {});
}

EditorUi.logError('Checksum ' + type + ' in ' + functionName,
null, this.getMode() + '.' + id,
'user_' + uid + ((this.sync != null) ?
'-client_' + this.sync.clientId : '-nosync') +
'-bytes_' + bytes + '-patches_' + patches.length +
((data != null) ? ('-json_' + data) : '') +
'-size_' + this.getSize() +
((checksum != null) ? ('-expected_' + checksum) : '') +
((current != null) ? ('-current_' + current) : '') +
((rev != null) ? ('-rev_' + this.ui.hashValue(rev)) : '') +
((latest != null) ? ('-latest_' + latest) : '') +
'-latestRev_' + this.ui.hashValue(
latestFile.getCurrentRevisionId()) +
('-latestVersion_' + latestVersion) +
('-latestAgent_' + latestAgent) +
('-latestType_' + latestType));

EditorUi.logEvent({category: 'CHECKSUM-ERROR-SYNC-FILE-' + id,
action: functionName, label: 'user_' + uid + ((this.sync != null) ?
'-client_' + this.sync.clientId : '-nosync') +
'-bytes_' + bytes + '-patches_' + patches.length +
'-size_' + this.getSize()});
}
catch (e)
{
// ignore
}
}), function() {});
}
catch (e)
{
Expand Down Expand Up @@ -2676,19 +2601,12 @@ DrawioFile.prototype.fileSaved = function(savedData, lastDesc, success, error, t

try
{
if (this.errorReportsEnabled)
{
this.sendErrorReport('Error in fileSaved', null, e);
}
else
{
var user = this.getCurrentUser();
var uid = (user != null) ? user.id : 'unknown';

EditorUi.logError('Error in fileSaved', null,
this.getMode() + '.' + this.getId(),
uid, e);
}
var user = this.getCurrentUser();
var uid = (user != null) ? user.id : 'unknown';

EditorUi.logError('Error in fileSaved', null,
this.getMode() + '.' + this.getId(),
uid, e);
}
catch (e2)
{
Expand Down
Loading

0 comments on commit d575ea7

Please sign in to comment.