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:
Barış Soner Uşaklı
2025-08-29 21:02:14 -04:00
parent a4674578e4
commit 9d4a9b83cc
2 changed files with 32 additions and 1 deletions

View File

@@ -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;