Repository navigation
Fix undefined IndexedDB result in onupgradeneeded handler - #207
sentry[bot] wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
[Low impact] The runtime change stays within browser-side editor storage. The reported autosave failure needs a working fix before merging.
|
| open.onupgradeneeded = (event) => | ||
| upgrade((event.target as IDBOpenDBRequest).result) |
There was a problem hiding this comment.
event.target is the same request as open, so this still reads the same .result property. The cast changes only TypeScript's view of the value. If open.result is undefined in the reported failure, this passes undefined to upgrade too, leaving local autosave unavailable. Please address the cause of the missing database rather than changing the reference used to read it.
Knowledge Base Used: Draft persistence and recovery
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/lib/editor/autosave/idb.ts
Line: 51-52
Comment:
**Autosave failure remains**
`event.target` is the same request as `open`, so this still reads the same `.result` property. The cast changes only TypeScript's view of the value. If `open.result` is undefined in the reported failure, this passes undefined to `upgrade` too, leaving local autosave unavailable. Please address the cause of the missing database rather than changing the reference used to read it.
**Knowledge Base Used:** [Draft persistence and recovery](https://app.greptile.com/basement/-/custom-context/knowledge-base/basementstudio/shader-lab/-/docs/editor-persistence.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| }, | ||
| "node_modules/@peculiar/asn1-csr": { | ||
| "vers |
There was a problem hiding this comment.
The new package-lock.json records different versions from bun.lock: next is 16.4.2 instead of 16.2.3, and @base-ui/react is 1.9.0 instead of 1.3.0. The project declares Bun, and CI installs only bun.lock, so CI does not check this second set of versions. Remove the unrelated npm lockfile to avoid maintaining conflicting dependency versions.
Prompt To Fix With AI
This is a comment left during a code review.
Path: package-lock.json
Line: 14599-14601
Comment:
**Dependency versions disagree**
The new `package-lock.json` records different versions from `bun.lock`: `next` is 16.4.2 instead of 16.2.3, and `@base-ui/react` is 1.9.0 instead of 1.3.0. The project declares Bun, and CI installs only `bun.lock`, so CI does not check this second set of versions. Remove the unrelated npm lockfile to avoid maintaining conflicting dependency versions.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Fixes TypeError when evaluating
db.objectStoreNamesduring IndexedDBonupgradeneeded.Changes
event.target.resultinstead ofopen.resultin theonupgradeneededhandler (IDB spec compliant).dbbeing nullish before callingupgrade()so environments where the database is unavailable fail gracefully instead of throwing.package-lock.jsonto keepbun.lockas the single source of truth.Fixes SHADER-LAB-1Q
@sentry <feedback>: Autofix iterates on these changes@sentry stop iterating: Autofix stops iterating on this runThis PR was automatically generated by Sentry at no cost. You can adjust this setting at any time.