apostrophe 2.227.8 → 2.227.10-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.227.10-beta.1 (2025-02-28)
|
|
4
|
+
|
|
5
|
+
* Improve docs locking system messages.
|
|
6
|
+
* Refresh stale docs locks that have the current context ID.
|
|
7
|
+
|
|
8
|
+
## 2.227.9 (2024-08-19)
|
|
9
|
+
|
|
10
|
+
* Update CKEDITOR combo styles to target all combos in the toolbar.
|
|
11
|
+
|
|
3
12
|
## 2.227.8 (2024-08-08)
|
|
4
13
|
|
|
5
14
|
### Changes
|
|
@@ -1078,7 +1078,7 @@ module.exports = function(self, options) {
|
|
|
1078
1078
|
self.verifyLock = function(req, id, contextId, callback) {
|
|
1079
1079
|
|
|
1080
1080
|
if (!(req && req.res)) {
|
|
1081
|
-
return callback(
|
|
1081
|
+
return callback('no req', 'You forgot to pass req as the first argument');
|
|
1082
1082
|
}
|
|
1083
1083
|
|
|
1084
1084
|
if (!id) {
|
|
@@ -1101,8 +1101,11 @@ module.exports = function(self, options) {
|
|
|
1101
1101
|
// Refresh the timestamp of an existing lock, if we still hold it
|
|
1102
1102
|
var criteria = {
|
|
1103
1103
|
_id: id,
|
|
1104
|
-
'advisoryLock._id': contextId
|
|
1105
|
-
|
|
1104
|
+
'advisoryLock._id': contextId
|
|
1105
|
+
|
|
1106
|
+
// The following line was commented in order to force-refresh a stale lock,
|
|
1107
|
+
// as long as the context ID is the same (same tab, so no risk of docs editing conflicts):
|
|
1108
|
+
// 'advisoryLock.updatedAt': { $gte: self.getAdvisoryLockExpiration() }
|
|
1106
1109
|
};
|
|
1107
1110
|
return self.db.update(criteria, {
|
|
1108
1111
|
$set: {
|
|
@@ -1117,14 +1120,16 @@ module.exports = function(self, options) {
|
|
|
1117
1120
|
{ advisoryLock: 1 },
|
|
1118
1121
|
function(err, info) {
|
|
1119
1122
|
if (err) {
|
|
1120
|
-
|
|
1123
|
+
message = err.message;
|
|
1124
|
+
return callback('error');
|
|
1121
1125
|
}
|
|
1122
1126
|
if (!info) {
|
|
1123
1127
|
return callback('notfound');
|
|
1124
1128
|
}
|
|
1125
1129
|
// A stale lock is effectively a missing lock
|
|
1126
1130
|
if (info.advisoryLock && info.advisoryLock.updatedAt < self.getAdvisoryLockExpiration()) {
|
|
1127
|
-
|
|
1131
|
+
message = req.__ns('apostrophe', 'The lock has expired.');
|
|
1132
|
+
return callback('stale-lock');
|
|
1128
1133
|
}
|
|
1129
1134
|
if ((!info.advisoryLock) || (info.advisoryLock._id !== contextId)) {
|
|
1130
1135
|
if (info.advisoryLock && info.advisoryLock.username === req.user.username) {
|