Draft
Conversation
The processEntitiesForCaseList check only detected GraphData→HTML transforms via processData(), so it always logged "ok" for string case types regardless of actual mismatch. Replace with direct case-type checks on the paginated entity list and the processed EntityBean array, so sb2/sb3 will surface mismatches that propagate through pagination and bean conversion. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Delete when resolved
When the case type mismatch surfaces on the BHA screen, log every DataInstance visible to the EntityScreen eval context: class, instanceId, source URI, and a tree walk sampling up to 500 cases per instance with their case_type values. Helps localize whether the 'results' instance itself is polluted or a separate casedb instance is being evaluated against. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The previous helper assumed a two-level tree shape (root > container > cases) and iterated root children. For a CaseInstanceTreeElement the root IS the case container, so the loop iterated all 359 user casedb cases and emitted a line each — blowing the log buffer before the 'results' instance could be logged. Detect both tree shapes: if root.getChildAt(0) is a 'case', treat root as the container; otherwise recurse one level. Skip detail on the casedb instance (always the full user casedb, not the bug focus). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Log the case search table name, cache key hash, case count, and case types right before returning the CaseInstanceTreeElement to the caller. Distinguishes between cache-key collision (same table, different keys), concurrent-request pollution (same table/key, fluctuating counts), and pre-return mutation (count differs from validateCaseTypesInStorage). Also updates USH-6370 notes with sentry_4 findings: the 'results' DataInstance sees 1189 cases of 4 types despite HQ returning only 184 capacity cases and SQLite validating clean in the same request. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previous sample-of-50 biased toward the first positions. sentry_5 had
1189 capacity cases sampled as all-capacity while entities at positions
>200 showed non-capacity types — the bug's fingerprint was invisible.
Emit a {case_type: count} histogram for the results instance (fires
only on Case Type header failures, so the full iteration is bounded).
casedb stays sampled since it's the user's full case DB and not the
focus. Also adds tmp/ to .gitignore for scratch analysis scripts.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Log getStorageCacheName() for each CaseInstanceTreeElement and sample up to 3 non-capacity positions in the results instance, cross-referencing the same positions in casedb. If both CaseInstanceTreeElements report storageCacheName=casedb and results[j].case_id matches casedb[j].case_id for non-capacity positions, the RecordObjectCache key collision between the real casedb and the search-results instance is confirmed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Set StorageInstanceTreeElement.USH6370_DIAGNOSTIC_LOG in a ThreadLocal at the start of MenuController.navigateSessionWithAuth (cleared in finally). In EntityListResponse inventory, append the captured bulk-load / first-hit events to the inventory log when the Case Type header gate matches. Includes commcare-core submodule bump for the ThreadLocal field and append hooks inside getElement. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Pass caseSearchTableName to CaseInstanceTreeElement so case search results cache under "casedb:<table_hash>" instead of plain "casedb". Prevents RecordObjectCache key collision with the user's casedb instance when both share a QueryContext during nodeset evaluation. Includes commcare-core submodule bump with the new constructor. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Product Description
Technical Summary
Safety Assurance
Safety story
Automated test coverage
QA Plan
Migrations
Special deploy instructions
Rollback instructions
Review