Skip to content

Fork review for upstream #765: module repository loading#5

Draft
Shallow-dusty wants to merge 10 commits into
masterfrom
review/pr-765-repo-loading-20260702
Draft

Fork review for upstream #765: module repository loading#5
Shallow-dusty wants to merge 10 commits into
masterfrom
review/pr-765-repo-loading-20260702

Conversation

@Shallow-dusty

Copy link
Copy Markdown
Owner

Fork-only Codex review surface for JingMatrix/Vector upstream PR JingMatrix#765 follow-up.\n\nHead under review: dbb0963 Retry module detail mirrors on parse failures.\n\nValidation already run locally: git diff --check; :app:compileDebugJavaWithJavac; :app:assembleDebug.\n\nThis PR is only for pre-upstream review and should not be merged.

Shallow-dusty and others added 4 commits June 22, 2026 10:57
Use the working backup repository API endpoint for module JSON, surface failed HTTP responses, and load full module details when README content is missing.

Keeps the browser action on the public modules.lsposed.org web page because the backup host only serves the JSON API.

Builds on the approach from JingMatrix#747 by byemaxx.

Co-authored-by: Qing <44231502+byemaxx@users.noreply.github.com>
@Shallow-dusty

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dbb09630dd

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +111 to +112
loadLocalData(false);
loaded = true;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep trying mirrors after parse failures

When a mirror returns HTTP 200 with a malformed or incompatible modules.json, loadLocalData(false) catches the Gson/stream exception internally, so execution returns here and loaded is set to true. That stops the new fallback loop before trying the next mirrors and leaves the just-written bad response in repo.json, so users whose first mirror has a bad cached/deployed response can lose the cached repo instead of falling back to modules.lsposed.org.

Useful? React with 👍 / 👎.


public void loadRemoteReleases(String packageName) {
App.getOkHttpClient().newCall(new Request.Builder().url(String.format(repoUrl + "module/%s.json", packageName)).build()).enqueue(new Callback() {
loadRemoteReleases(packageName, 0);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reuse the known working mirror for detail loads

After the repo index or a previous detail request succeeds on a fallback mirror, repoUrl is updated, but this entrypoint always restarts module-detail loads at repoUrls[0]. In environments where the first mirror is blocked or timing out while a later mirror works, every README/release load, including the new automatic README fetch, waits for that failing mirror before reaching the usable one; start from the current repoUrl instead of always index 0.

Useful? React with 👍 / 👎.

@Shallow-dusty

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d08a313709

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +148 to +149
updateLatestVersion(repoModules, channel);
onlineModules = modules;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Notify listeners after replacing module map

In the successful loadRemoteData() path, replaceRepoModules() now relies on updateLatestVersion() to fire onRepoLoaded(), but that notification happens before onlineModules is swapped. During the normal startup background refresh (loadLocalData(true) -> loadRemoteData()), listeners such as RepoFragment.refresh() and RepoItemFragment.refreshModuleFromRepo() read the old cached map and there is no later success notification after line 149, so the UI can keep showing stale module data until another manual refresh. Assign the new map before notifying, or emit a post-assignment onRepoLoaded() for successful remote loads.

Useful? React with 👍 / 👎.

@Shallow-dusty

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f4ad0161a3

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

private void loadRemoteModuleIfReadmeMissing() {
var currentModule = refreshModuleFromRepo();
if (currentModule == null || currentModule.getName() == null) return;
if (remoteModuleLoadRequested || currentModule.releasesLoaded || hasReadme(currentModule)) return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Clear the readme fetch guard after detail loads

When the automatic detail fetch succeeds, remoteModuleLoadRequested stays true. If a repo-list refresh then replaces module with the summary object that still has no readme (for example the normal startup refresh completing after the detail request), this guard prevents loadRemoteModuleIfReadmeMissing() from fetching the detail JSON again, so the Readme tab is rendered as empty until the user manually loads releases. Clear this flag on successful onModuleReleasesLoaded() so a later summary refresh can rehydrate the readme.

Useful? React with 👍 / 👎.

@Shallow-dusty

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 83553ab56b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

private void loadRemoteModuleIfReadmeMissing() {
var currentModule = refreshModuleFromRepo();
if (currentModule == null || currentModule.getName() == null) return;
if (remoteModuleLoadRequested || currentModule.releasesLoaded || hasReadme(currentModule)) return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reset stale readme fetch guard after view teardown

When the automatic detail fetch is started and the fragment view is destroyed before the OkHttp callback runs, onDestroyView() removes this listener, so neither onThrowable nor onModuleReleasesLoaded clears remoteModuleLoadRequested. Returning to the same back-stack fragment then hits this guard and skips the readme/detail fetch even though no request is in flight, leaving modules with missing cached READMEs stuck on the empty placeholder until the user manually loads releases.

Useful? React with 👍 / 👎.

@Shallow-dusty

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 74f60aeb4d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@Shallow-dusty

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 74f60aeb4d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

if (module == null || module.getName() == null) return module;
var updatedModule = RepoLoader.getInstance().getOnlineModule(module.getName());
if (updatedModule != null) {
module = updatedModule;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep detailed module data across repo refreshes

When a module detail request has already populated this.module with README/full releases, a later repo refresh can replace RepoLoader's entry with the summary object from modules.json (the code below exists specifically for summaries that lack README data). This assignment then discards the already-loaded detail object, so the README/releases can flicker back to empty/truncated data and require another network request; if that retry fails, the user loses content that was already loaded. Please preserve or merge the detailed instance when it has README data or releasesLoaded instead of blindly overwriting it.

Useful? React with 👍 / 👎.

@Shallow-dusty

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 145ea213aa

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

refreshModuleFromRepo();
loadRemoteModuleIfReadmeMissing();
if (releaseAdapter != null) {
runAsync(releaseAdapter::loadItems);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve loaded releases on repo refresh

When a repo refresh arrives after this fragment has already fetched full module details, refreshModuleFromRepo() intentionally keeps the detailed module, but this reload still calls ReleaseAdapter.loadItems(), which first reads RepoLoader.getReleases(module.getName()). The refresh has just replaced RepoLoader's map with the modules.json summary, so the adapter is repopulated with the truncated summary release list while module.releasesLoaded remains true, removing the load-more row and hiding older releases. Prefer the detailed module when it is already loaded, or skip this reload in that case.

Useful? React with 👍 / 👎.

@Shallow-dusty

Copy link
Copy Markdown
Owner Author

@codex review

1 similar comment
@Shallow-dusty

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 145ea213aa

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

refreshModuleFromRepo();
loadRemoteModuleIfReadmeMissing();
if (releaseAdapter != null) {
runAsync(releaseAdapter::loadItems);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve full release data on repo refresh

When a repo refresh arrives after this fragment has already loaded full module details, refreshModuleFromRepo() keeps module.releasesLoaded == true, but this reload calls ReleaseAdapter.loadItems(), which reads from RepoLoader.getReleases() first. The loader entry has just been replaced with the modules.json summary, so the adapter can show only the truncated summary releases while getItemCount() still suppresses the load-more row based on the detailed module, leaving users unable to load the missing releases after a background/full refresh.

Useful? React with 👍 / 👎.

@Shallow-dusty

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 7db9055b44

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

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.

1 participant