mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 02:55:58 +01:00 
			
		
		
		
	fix: mainPid detection in unprocessed ids in assertTopic
This commit is contained in:
		| @@ -240,13 +240,13 @@ Notes.assertTopic = async (uid, id) => { | |||||||
| 	winston.info(`[notes/assertTopic] ${unprocessed.length} new note(s) found.`); | 	winston.info(`[notes/assertTopic] ${unprocessed.length} new note(s) found.`); | ||||||
|  |  | ||||||
| 	const [ids, timestamps] = [ | 	const [ids, timestamps] = [ | ||||||
| 		unprocessed.map(n => n.pid), | 		unprocessed.map(n => (utils.isNumber(n.pid) ? parseInt(n.pid, 10) : n.pid)), | ||||||
| 		unprocessed.map(n => n.timestamp), | 		unprocessed.map(n => n.timestamp), | ||||||
| 	]; | 	]; | ||||||
|  |  | ||||||
| 	// mainPid doesn't belong in posts zset | 	// mainPid doesn't belong in posts zset | ||||||
| 	if (ids.includes(mainPid)) { | 	if (ids.includes(parseInt(mainPid, 10))) { | ||||||
| 		const idx = ids.indexOf(mainPid); | 		const idx = ids.indexOf(parseInt(mainPid, 10)); | ||||||
| 		ids.splice(idx, 1); | 		ids.splice(idx, 1); | ||||||
| 		timestamps.splice(idx, 1); | 		timestamps.splice(idx, 1); | ||||||
| 	} | 	} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user