Skip to content

fix(resources): complete offline manifests beyond 100 search hits (#431) - #436

Closed
mattrace-gloo wants to merge 1 commit into
mainfrom
mrace/fix/431-complete-resource-manifest
Closed

mattrace-gloo wants to merge 1 commit into
mainfrom
mrace/fix/431-complete-resource-manifest

Conversation

@mattrace-gloo

Copy link
Copy Markdown
Contributor

TLDR

Prepare Offline manifests no longer re-slice a successfully enumerated Aquifer search back to 100 items per configuration. When bounded pagination collects every matching resource (including counts above 100), the response stays truncated: false with full hydration and accurate sizes. When the 20-page search ceiling stops collection without provider proof of completeness, truncated stays true so clients cannot treat a partial catalogue as complete.

Details

Refs #431
Related mobile acceptance: fluent-mobile#736 (do not close until Android QA on a deployed revision)

  • Base: origin/main @ c8d4cb6
  • Root cause: getPrepareOfflineManifest set truncated and slice(0, 100) after searchAllResources had already paginated (100/page, ≤20 pages).
  • Fix: return { items, complete } from bounded Aquifer enumeration; hydrate all collected items; set truncated only when complete === false.
  • No public pagination/continuation protocol change; no arbitrary hydration-cap increase; no unbounded load.
  • Does not duplicate #433 (#432 strict hydration failure). Large-manifest hydration still uses existing skip-on-failure online policy for non-manifest routes; offline strict-fail remains fix(resources): reject incomplete offline hydration (#432) #433.
  • Dependency note: full combined correctness for “one hydrate fails amid >100 hits → 502” also needs fix(resources): reject incomplete offline hydration (#432) #433. This PR only fixes search-exhaustion / 100-cap completeness.
  • No overlap with held #435 image caption/license builder work.
  • #424 modularization does not touch translation-resources (compared file list). #411 only adds Bible-text 404 httpStatus on Aquifer errors — no intentional interaction.
  • No deploy in this PR.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Docs / chore

Technical changes

  • src/lib/services/aquifer/aquifer.client.ts — searchAllResources returns { items, complete }; export AQUIFER_MAX_SEARCH_PAGES
  • src/lib/services/aquifer/aquifer.types.ts — AquiferResourceSearchEnumeration
  • src/domains/translation-resources/translation-resources.service.ts — remove per-config 100 slice; hydrate full enumeration; truncated from !complete
  • src/domains/translation-resources/translation-resources.types.ts — OpenAPI truncated description updated
  • Focused route + Aquifer client regressions (synthetic mocks, not live payloads)

Testing

  • Focused Vitest (--configLoader=runner): 61 passed across translation-resources + aquifer.client suites (includes +2 manifest / +2 pagination completeness cases)
  • prettier --check on touched files: pass
  • eslint on touched domain/aquifer paths: pass
  • tsc --noEmit: pass
  • npm run deadcode / knip: blocked locally — knip@5.88.1 not installed in shared node_modules; stock script invokes bare npx (not run; no install)
  • test:db / test:live: skipped (no isolated DB / no live Aquifer credentials)
  • scripts/check-docs-structure.sh: fails on pre-existing docs/.DS_Store (unrelated; not modified here)
  • No live API load, no dependency acquisition, no deploy

How to verify

  1. Unit: from repo root, ./node_modules/.bin/vitest run --configLoader=runner src/domains/translation-resources src/lib/services/aquifer/aquifer.client.test.ts — expect pass including #431 >100 complete and page-ceiling incomplete cases.
  2. After deploy (out of scope): Android Prepare Offline for a single assigned chapter that previously emitted truncated_manifest (e.g. project 12) — expect non-truncated catalogue with accurate sizes; record runtime revision against mobile #736 before closing either issue.

Follow-ups

Made with Cursor

Stop re-slicing bounded Aquifer search results at 100 and report truncated
only when provider pagination metadata cannot prove enumeration finished.

Co-authored-by: Cursor <cursoragent@cursor.com>
@mattrace-gloo mattrace-gloo self-assigned this Oct 21, 2026
@coderabbitai

coderabbitai Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 13 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2067741a-cd0c-419c-9cb5-55e16acf1c93
📥 Commits

Reviewing files that changed from the base of the PR and between c8d4cb6 and 807f977.

📒 Files selected for processing: 9
  • src/domains/translation-resources/translation-resources.license.test.ts
  • src/domains/translation-resources/translation-resources.range.test.ts
  • src/domains/translation-resources/translation-resources.service.ts
  • src/domains/translation-resources/translation-resources.test-fixtures.ts
  • src/domains/translation-resources/translation-resources.test.ts
  • src/domains/translation-resources/translation-resources.types.ts
  • src/lib/services/aquifer/aquifer.client.test.ts
  • src/lib/services/aquifer/aquifer.client.ts
  • src/lib/services/aquifer/aquifer.types.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

Prepare Offline manifest truncates resources above 100 per configuration without client continuation

1 participant