TypeId is not consistent and how to safely remove adapter
- Dominant language
- Dart
- Stars
- 4.4k
- Forks
- 449
- PR merge metrics
- No merged PRs in 30d
Description
In our previous app version we registered adapter with `typeId = 132`. In the new version we completely remove that adapter but we are facing an issue when the user updates the app with the error message `Cannot read, unknown typeId: 132. `. To fix that we `ignore` that typeId because **there is no function to remove registered adapter**. But the new issue comes, if we ignore that typeId we get the error message `HiveError: Cannot read, unknown typeId: 132. Did you forget to register an adapter?` and when checking the log is directed to this adapter.

if you see that typeId is `131` but why Hive detect that adapter as `132`
The steps to replicate that issue:
1. Create an adapter with typeId = 132 called AdapterA
2. Create an adapter with typeId = 131 called AdapterB
3. Install the app and use that adapter
4. Remove the AdapterA
5. Ignore the typeId 132
6. Run the project
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the six adapter registration, removal, and ignore steps described in the issue, then trace the adapter registration and ignored-type handling involved in the reported error. Done means the typeId remains consistent and updating an app after removing AdapterA no longer produces a misleading unknown-adapter error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100