Skip to content

plugins: support rich messages in repositories - #80

Open
berkmirsatk wants to merge 3 commits into
teidesu:mainfrom
berkmirsatk:fix/rich-plugin-repositories
Open

berkmirsatk wants to merge 3 commits into
teidesu:mainfrom
berkmirsatk:fix/rich-plugin-repositories

Conversation

@berkmirsatk

@berkmirsatk berkmirsatk commented Oct 23, 2026 •

Copy link
Copy Markdown

Support plugin discovery from rich channel messages in repository listings and update checks.

Problem

Plugin repositories only listed .inu.js files sent as regular documents. Repositories were read with messages.search and inputMessagesFilterDocument, which does not return files embedded in rich messages. A channel that publishes each release as a rich post with the installer inside showed no plugins, and installs from those posts could not receive updates.

Changes

  • Read channel history instead of a document search. loadPage uses messages.getHistory and collects installers from both media.document and rich_message.documents. A file repeated inside one post is listed once; separate installers in one post are listed separately.
  • Complete partial rich messages. History can return a rich message with part = true, which may omit the installer. Such messages are completed with getRichMessage before deciding which plugins a page contains. They are resolved one at a time to keep channel order and bound the requests in flight.
  • Refresh expired file references for rich posts. refreshDocument completes the post the same way and resumes only the same document, so a post edited to a different installer cannot switch an in-flight download.
  • Unique row ids. PluginRepoActivity keys rows by document id, since one post can now hold several installers, and numbers documents as first seen instead of truncating the random 64-bit id to 16 bits.
  • Pages without plugins still advance the history cursor, and an empty page keeps loading older messages as before.

Behaviour to note

If completing a single partial rich message fails, the whole page is treated as failed so it can be retried, instead of showing an incomplete repository. This is right for network and server errors, but a rich post that can never be loaded (deleted or no longer accessible) would make that repository fail on every update check. If you prefer, I can make it fail the page only on network/server errors and skip a message the server reports as missing.

Validation

  • Verified listing, download, installation and plugin operation on a physical Android device.
  • New device tests in PluginReposTest cover regular and rich installers with their origin, completion of partial rich messages, failed and mismatched completions, cursor advance on pages without plugins, and expired references for rich documents, including an edited installer.
  • All seven regression tests passed on Android 11.
  • Full APK build passed.

Screenshots

Plugin discovery from a rich channel post, verified on a physical Android device.
Screenshot_2026-10-23-16-11-03-420_desu.inugram.jpg
Screenshot_2026-10-23-14-01-46-496_desu.inugram.beta.jpg

Message responses are plain Java objects, so they need no disableFree
guard; the guard was also released before the paginated lookups that
still read the page finished. Repository rows now number documents as
first seen instead of truncating random document ids to 16 bits.
@teidesu

teidesu commented Oct 25, 2026

Copy link
Copy Markdown
Owner

i dont really think it's a good idea to fetch the entire channel history to search for plugins

i believe the correct fix here would be a server-side fix for the filter to include files from rich messages

This branch has not been deployed

No deployments
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.

2 participants