apache / apache/ponymail-foal

Confusion over mbox mid and id properties

Open
#184 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
45
Forks
23
PR merge metrics
No merged PRs in 30d

Description

The indexes do not have an id property; they use mid instead.

However the 'id' property is frequently referenced in the code, and messages.py compensates for this by creating id as a copy of mid in the returned json. This is a bad idea, and is likely to cause issues.

For example, mgmt.py tries to update the mbox entry and fails because "id" was so helpfully added by messages.py.

Of course it is possible to drop the id field before the update, but this does not solve the issue of what happens if mid and id ever diverge?

There should be at most one id field

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing how messages.py creates the id field from mid and how mgmt.py uses the returned JSON when updating an mbox entry. Check the index and update paths to identify the single property that should be used consistently. Done means updates no longer fail because of the extra id field and the code no longer permits mid and id to diverge.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.