# Prompt — Debug a bridge/native issue (debug)

> Generated by orbit:prompt-generator for `cordova-plugin-insider`. Target tool: Claude Code. Based on `.orbit-output/config/architecture/`.

---

```xml
<context>
Project: cordova-plugin-insider. Data flow: JS (js/) → Utils.asyncExec → cordova.exec → native dispatcher (src/android execute(), src/ios selector) → Insider SDK. Native→JS callbacks via cordova.fireDocumentEvent('ins_notification_handle' | 'ins_insider_id_listener' | 'ins_foreground_push_callback').
Read first: @.orbit-output/config/MASTER.md, @.orbit-output/config/architecture/CODE-CATALOG.md.

Common failure surfaces in this codebase:
- Platform branching: a method that no-ops on the wrong platform (cordova.platformId guard) being called on that platform.
- Serialization: objects not passed through parseObjectWithTypes; dates sent as ISO instead of epoch-ms string; booleans not lowercased.
- Validation bail: checkParameters returning true (invalid) silently, so no native call happens.
- Missing parity: JS calls an action whose native handler doesn't exist on one platform.
- Known debt: iOS registerCallback: builds JSON by string interpolation.
</context>

<task>
Debug: {{problem_description}}
Platform: {{ios | android | both}}
Error/symptom:
{{error_message_or_observed_behavior}}
Relevant code (if known):
{{paste_code_or_file_refs}}
Expected vs actual: {{expected}} vs {{actual}}
</task>

<request>
1. Trace the call across layers (JS method → constant/reference → native handler → SDK) and pinpoint where it breaks.
2. Identify the root cause (cite file:line).
3. Provide a minimal fix that preserves the established patterns.
4. Add/adjust a Jest test that reproduces the bug at the JS layer where possible.
5. Note any parity or platform-guard implication.
</request>

<constraints>
- Smallest correct change; keep existing patterns.
- Don't edit generated www/ or .orbit-output/.
- Run `npm test` after the fix.
</constraints>
```

## Context files to include
| File | Reason |
|------|--------|
| `js/Utils.js`, `js/Constants.js` | Call path + references |
| relevant `js/*.js` + `src/android/InsiderPlugin.java` + `src/ios/InsiderPlugin.m` | Cross-layer trace |
| `.orbit-output/config/architecture/boundaries.md` | Known tech-debt |
