Merge commit 'cddac03a5f8ceef7fd4121c01a65a5590726be2b' into v3.x

isekai-main
Misty Release Bot 1 year ago
commit 43299ab804

@ -1,3 +1,60 @@
#### v3.4.2 (2023-09-12)
##### Chores
* up harmony (bd94f263)
* up harmony (46f260b5)
* up harmony (62afd0bd)
* up composer/persona (5c628c56)
* up harmony (3e07c18d)
* up deps (3f7de1c7)
* up harmony (512c44d5)
* up harmony (319d3b1f)
* up themes (d7a7c355)
* incrementing version number - v3.4.1 (01e69574)
* update changelog for v3.4.1 (f24a334c)
* incrementing version number - v3.4.0 (fd9247c5)
* incrementing version number - v3.3.9 (5805e770)
* incrementing version number - v3.3.8 (a5603565)
* incrementing version number - v3.3.7 (b26f1744)
* incrementing version number - v3.3.6 (7fb38792)
* incrementing version number - v3.3.4 (a67f84ea)
* incrementing version number - v3.3.3 (f94d239b)
* incrementing version number - v3.3.2 (ec9dac97)
* incrementing version number - v3.3.1 (151cc68f)
* incrementing version number - v3.3.0 (fc1ad70f)
* incrementing version number - v3.2.3 (b06d3e63)
* incrementing version number - v3.2.2 (758ecfcd)
* incrementing version number - v3.2.1 (20145074)
* incrementing version number - v3.2.0 (9ecac38e)
* incrementing version number - v3.1.7 (0b4e81ab)
* incrementing version number - v3.1.6 (b3a3b130)
* incrementing version number - v3.1.5 (ec19343a)
* incrementing version number - v3.1.4 (2452783c)
* incrementing version number - v3.1.3 (3b4e9d3f)
* incrementing version number - v3.1.2 (40fa3489)
* incrementing version number - v3.1.1 (40250733)
* incrementing version number - v3.1.0 (0cb386bd)
* incrementing version number - v3.0.1 (26f6ea49)
* incrementing version number - v3.0.0 (224e08cd)
##### Bug Fixes
* **deps:** bump 2factor (6bc2b6c5)
* move database call used to associate a NodeBB session UUID to its express session id into user.auth.addSession, which is the only time it is called (e1bced8c)
* toMid to posts you cant see (53106c00)
* closes #11982, fix element in prepEdit (e4ecb96f)
* prep edit so textarea isn't below text input (f2c4041f)
##### Refactors
* reduce socket.emits for typing (aebd9278)
##### Tests
* remove errant .only() (9dc9d5ef)
* fix room count (66251166)
#### v3.4.1 (2023-09-06) #### v3.4.1 (2023-09-06)
##### Chores ##### Chores

@ -92,7 +92,7 @@
"mousetrap": "1.6.5", "mousetrap": "1.6.5",
"multiparty": "4.2.3", "multiparty": "4.2.3",
"nconf": "0.12.0", "nconf": "0.12.0",
"nodebb-plugin-2factor": "7.2.2", "nodebb-plugin-2factor": "7.3.0",
"nodebb-plugin-composer-default": "10.2.20", "nodebb-plugin-composer-default": "10.2.20",
"nodebb-plugin-dbsearch": "6.2.2", "nodebb-plugin-dbsearch": "6.2.2",
"nodebb-plugin-emoji": "5.1.5", "nodebb-plugin-emoji": "5.1.5",

@ -7,19 +7,20 @@ import { confirm } from 'bootbox';
const baseUrl = config.relative_path + '/api/v3'; const baseUrl = config.relative_path + '/api/v3';
function call(options, callback) { async function call(options, callback) {
options.url = options.url.startsWith('/api') ? options.url = options.url.startsWith('/api') ?
config.relative_path + options.url : config.relative_path + options.url :
baseUrl + options.url; baseUrl + options.url;
if (typeof callback === 'function') { if (typeof callback === 'function') {
xhr(options, callback); xhr(options).then(result => callback(null, result), err => callback(err));
return; return;
} }
return new Promise((resolve, reject) => { try {
xhr(options, function (err, data) { const result = await xhr(options);
if (err) { return result;
} catch (err) {
if (err.message === 'A valid login session was not found. Please log in and try again.') { if (err.message === 'A valid login session was not found. Please log in and try again.') {
return confirm('[[error:api.reauth-required]]', (ok) => { return confirm('[[error:api.reauth-required]]', (ok) => {
if (ok) { if (ok) {
@ -27,16 +28,11 @@ function call(options, callback) {
} }
}); });
} }
throw err;
return reject(err);
} }
resolve(data);
});
});
} }
async function xhr(options, cb) { async function xhr(options) {
// Normalize body based on type // Normalize body based on type
const { url } = options; const { url } = options;
delete options.url; delete options.url;
@ -79,16 +75,14 @@ async function xhr(options, cb) {
if (!res.ok) { if (!res.ok) {
if (response) { if (response) {
return cb(new Error(isJSON ? response.status.message : response)); throw new Error(isJSON ? response.status.message : response);
} }
return cb(new Error(res.statusText)); throw new Error(res.statusText);
} }
cb(null, ( return isJSON && response && response.hasOwnProperty('status') && response.hasOwnProperty('response') ?
isJSON && response && response.hasOwnProperty('status') && response.hasOwnProperty('response') ?
response.response : response.response :
response response;
));
} }
export function get(route, data, onSuccess) { export function get(route, data, onSuccess) {

@ -106,7 +106,7 @@ async function checkPlugins() {
current = plugins[suggestObj.package]; current = plugins[suggestObj.package];
suggested = suggestObj.version; suggested = suggestObj.version;
if (suggestObj.code === 'match-found' && semver.gt(suggested, current)) { if (suggestObj.code === 'match-found' && semver.valid(current) && semver.valid(suggested) && semver.gt(suggested, current)) {
return { return {
name: suggestObj.package, name: suggestObj.package,
current: current, current: current,

@ -317,7 +317,8 @@ module.exports = function (Topics) {
Topics.markAllRead = async function (uid) { Topics.markAllRead = async function (uid) {
const cutoff = await Topics.unreadCutoff(uid); const cutoff = await Topics.unreadCutoff(uid);
const tids = await db.getSortedSetRevRangeByScore('topics:recent', 0, -1, '+inf', cutoff); let tids = await db.getSortedSetRevRangeByScore('topics:recent', 0, -1, '+inf', cutoff);
tids = await privileges.topics.filterTids('topics:read', tids, uid);
Topics.markTopicNotificationsRead(tids, uid); Topics.markTopicNotificationsRead(tids, uid);
await Topics.markAsRead(tids, uid); await Topics.markAsRead(tids, uid);
await db.delete(`uid:${uid}:tids_unread`); await db.delete(`uid:${uid}:tids_unread`);

Loading…
Cancel
Save