https://gitlab.synchro.net/main/sbbs/-/commit/79c2da31989fcc7cf844a90d
Modified Files:
docs/v322_new.md exec/imapservice.js
Log Message:
imapservice: build a folder's index with one read; match UIDs to messages
read_index() called get_msg_index() once per message to build the
selected folder's index, and update_status() rebuilds it whenever the
base's last_msg changes. For INBOX that is the mail base, whose last_msg changes whenever anyone on the system receives mail, so every connected
client re-read the whole mail index one record at a time. Read it with a
single get_index() call; vote records, which get_msg_index() returned as
null, are skipped explicitly. On a 9,364-message mail base: 40 ms -> 25 ms
per rebuild on Linux, more where each read is a network round trip.
parse_seq_set() iterated every number of a UID range, so "UID FETCH 1:*"
looped up to last_msg (752,280 on that base) and a range ending in
4294967295, as some clients send, would loop for about four billion
numbers. A UID range is now matched against the folder's messages, and
a sequence-number range is clamped to the number of messages.
Old and new read_index()/parse_seq_set() produce identical results on the
mail base for two users and on two subs, for full, reversed, duplicate,
'*', out-of-range and malformed sets.
Part of #1340.
Co-Authored-By: Claude Opus 5.5 <
noreply@anthropic.com>
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net