fix: gracefully handle non-existent tables and add integration tests#9
fix: gracefully handle non-existent tables and add integration tests#9
Conversation
…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>
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Implemented the testing plan from
docs/PLAN.md.tests/bug_integration_test.gowith 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).tx.goto gracefully handlesyscall/jspanics when attempting to retrieve an object store for a non-existent table by wrappingd.db.Call("transaction", tableName, mode)with a deferredrecover(), allowing it to return a Go error instead of a fatal crash.PR created automatically by Jules for task 214477955430381092 started by @cdvelop