Skip to content

feat: serve an appversions.json index file to clients via IMAP metadata - #1038

Merged
hpk42 merged 1 commit into
mainfrom
hpk/appversions
Aug 13, 2026
Merged

feat: serve an appversions.json index file to clients via IMAP metadata#1038
hpk42 merged 1 commit into
mainfrom
hpk/appversions

Conversation

@hpk42

@hpk42 hpk42 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

fixes #1037
This is designed to help implement self-updating APKs (and later other clients), see core counterpart chatmail/core#8557

@adbenitez adbenitez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@missytake missytake left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No big deal to merge this I think. three small nitpicks:

Comment thread chatmaild/src/chatmaild/defaults/appversions.json
Comment thread chatmaild/src/chatmaild/config.py Outdated
Comment on lines +66 to +68
self.appversions_path = Path(
params.pop("appversions_path", "/usr/local/lib/chatmaild/appversions.json")
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure whether this needs to be a configurable value tbh. I think hardcoding this path would be fine. Not so important though, as operators don't really need to find out about it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i removed it completely.

Comment thread cmdeploy/src/cmdeploy/deployers.py Outdated
)

deployer.put_file(
src=get_reporoot().joinpath("APPVERSIONS.json").open("rb"),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I think the file should rather be in cmdeploy/src/cmdeploy than reporoot - if we link to it from CONTRIBUTING.md, client devs will be able to find it I think. But that's just cleanliness preference I guess.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, discussed with @r10s and shifted it to chatmaild python package into a chatmaild/defaults/appversions.json (no need to capitalize as is only common at repo root) where we can also move the chatmail.ini.

@j4n j4n left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good from what I can understand, however, the 24h refresh suggestion from #1037 seems worth mentioning as being not addressed yet; relay releases were indeed few and far between compared to client releases in the last months.

@@ -0,0 +1,15 @@
{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this file maybe have a timestamp?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it wouldn't help much currently with freshness of app versions to users. Freshness pipe from relay-repo -> relay-deployment -> core reading new metadata -> UI showing "update available" rather depends on core currently. it's not clear what checks/automatizations we want to do, so let's stick with the minimum data for now.

@hpk42
hpk42 temporarily deployed to staging.chatmail.at/doc/relay/ August 13, 2026 08:54 — with GitHub Actions Inactive
This is designed to help implement self-updating APKs (and later other clients),
see counterpart chatmail/core#8557
logging.exception(f"failed to read {path}")
return None
# the dict protocol is line-based, keep the value single-line
return json.dumps(data, separators=(",", ":"))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the separators are just to minimize the generated string. they would be ", " and ": " otherwise :)

@hpk42
hpk42 merged commit 33f9cdd into main Aug 13, 2026
9 checks passed
@hpk42
hpk42 deleted the hpk/appversions branch August 13, 2026 10:54
@r10s r10s changed the title feat: serve an APPVERSIONS.json index file to clients via IMAP metadata feat: serve an appversions.json index file to clients via IMAP metadata Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add "client version information" to IMAP METADATA

5 participants