The previous ENOENT check in getLogoSize never worked because image.size
passes the path directly to sharp, which throws a plain Error with message
"Input file is missing" rather than a Node.js ENOENT error. This caused
saving any admin settings to fail when brand:logo was set but the x50 file
was missing (e.g. after a fresh deployment).
syncBacklinks expects raw post content, html was passed to it from onNewPost since it was switched to use getPostSummary
backlinkRegex was matching ${nconf.get('url')}/topic/1aef954c-d0dc-45cf-acf2-e3a59f6cc134/foo and return tid=1 instead of the uuid
remove useless if check in syncBacklinks
fixed parseInts on tids
current - remove are both arrays use .length
* fix: deduplicate postgres sorted set bulk ops to prevent pkey violation
sortedSetIncrByBulk and sortedSetAddBulk did not deduplicate (key, value)
pairs before INSERT, causing "duplicate key value violates unique constraint
legacy_zset_pkey" errors since PostgreSQL ON CONFLICT only resolves against
existing table rows, not within-statement duplicates.
Also adds missing pageviews:ap metrics to analyticsKeys sorted set.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: use upsert with RETURNING to prevent postgres analytics write failures
Replace the INSERT ON CONFLICT DO NOTHING + separate SELECT verification
pattern with INSERT ON CONFLICT DO UPDATE RETURNING. The old pattern had
an unreliable gap between INSERT and SELECT causing random "failed to
insert keys for objects" errors that blocked all analytics writes.
The no-op upsert (DO UPDATE SET type = existing type) guarantees every
row is returned via RETURNING, eliminating the need for a separate SELECT
and the "missing keys" check entirely. Also deduplicates the keys array
to prevent "cannot affect row a second time" errors with DO UPDATE.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- New params for getSortedTopics (includeRemote, followingOnly)
- Ability to show latest (followers only) or latest (all), ?all query param to discriminate
- World now always shows posts from the local forum
- Popular sort will be followers-only + local