Skip to content

fix: gracefully handle non-existent tables and add integration tests#9

Open
cdvelop wants to merge 1 commit intomainfrom
jules-214477955430381092-770d92fc
Open

fix: gracefully handle non-existent tables and add integration tests#9
cdvelop wants to merge 1 commit intomainfrom
jules-214477955430381092-770d92fc

Conversation

@cdvelop
Copy link
Copy Markdown
Collaborator

@cdvelop cdvelop commented Mar 2, 2026

Implemented the testing plan from docs/PLAN.md.

  • Created tests/bug_integration_test.go with minimal models and 7 test scenarios (Multiple Initialization, Wait for Success, TEXT Primary Key, NUMERIC Primary Key, Table Not Found, Cursor Concurrency, Empty Result Behavior).
  • Modified tx.go to gracefully handle syscall/js panics when attempting to retrieve an object store for a non-existent table by wrapping d.db.Call("transaction", tableName, mode) with a deferred recover(), allowing it to return a Go error instead of a fatal crash.
  • Ran tests in WASM environment and verified all pass.
  • Verified pre-commit steps and requested code review.

PR created automatically by Jules for task 214477955430381092 started by @cdvelop

…nting integration tests

This commit implements the testing plan from docs/PLAN.md by adding `bug_integration_test.go` to test IndexedDB adapter behaviors including multiple initialization, numeric/text PKs, cursor concurrency, missing records, and missing tables.

Additionally, it resolves a panic uncovered by the "Table Not Found" test. When executing a transaction on an uninitialized or missing object store, IndexedDB throws a JS exception which `syscall/js` translates into a Go panic. This commit adds a deferred `recover()` block inside `getStore` to cleanly catch the panic and return a standard Go `error`.

Co-authored-by: cdvelop <44058491+cdvelop@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

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