Bug: shortLinks are not guaranteed unique, especially with the original generator
- Dominant language
- JavaScript
- Stars
- 80
- Forks
- 32
- PR merge metrics
- No merged PRs in 30d
Description
The shortLink feature works by truncating the database message id to 18 charactes and then converting it to base 36. To recover a message, the short link is decoded, and the first matching mail with the same prefix is returned.
In the case of the original generator, the first 18 characters of the id only depend on the message body. If the same message is sent to multiple mailing lists, they will all have the same shortLink. However only one will ever be retrieved currently.
In the case of the "medium" generator, the first 18 characters are part of a sha256 hash which will be unique within the database. There are billions of hashes with the same prefix, however the chances of two having the same prefix should be very small, but not impossible.
One solution is to ensure that shortLinks return all matching messages rather than just the first match.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing the shortLink generation and lookup paths, comparing the original and medium generators described in the issue. Verify how matching messages are selected; done means a shortLink can return all matching messages rather than only the first one, including messages sent to multiple mailing lists.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100