mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-14 10:37:45 +01:00
fix: closes #13624, update post fields before schedule code
tldr when reschedule was called it was still using the timestamp in the future when adding to cid:<cid>:pids causing that post to get stuck at the top of that zset, which led to the bug in this issue
This commit is contained in:
@@ -49,12 +49,14 @@ module.exports = function (Posts) {
|
||||
uid: data.uid,
|
||||
});
|
||||
|
||||
// needs to be before editMainPost, otherwise scheduled topics use wrong timestamp
|
||||
await Posts.setPostFields(data.pid, result.post);
|
||||
|
||||
const [editor, topic] = await Promise.all([
|
||||
user.getUserFields(data.uid, ['username', 'userslug']),
|
||||
editMainPost(data, postData, topicData),
|
||||
]);
|
||||
|
||||
await Posts.setPostFields(data.pid, result.post);
|
||||
const contentChanged = ((data.sourceContent || data.content) !== oldContent) ||
|
||||
topic.renamed ||
|
||||
topic.tagsupdated;
|
||||
|
||||
Reference in New Issue
Block a user