Closed Namli1 closed 4 months ago
v.3 and v.4 are both dev releases, which aren't compatible with the old version, so when allowing the newer versions as well, one might upgrade accidentally to the dev release and the old sessions aren't available. So I think it's better when you try to solve the issue via dependency_overrides
Thank you for you reply. I have actually already tried resolving the issue with dependency_overrides, but that way the local_storage.dart file in supabase_flutter
will throw errors because hive: ^4.0.0
is not backward compatible with hive: ^2.2.1
.
For example, you get an error like (when using hive: ^4.0.0
):
../../../../.pub-cache/hosted/pub.dev/supabase_flutter-2.3.1/lib/src/local_storage.dart:85:5: Error: 'HiveCipher' isn't a type.
HiveCipher? encryptionCipher;
I am not sure if there is a way to simply ignore the file where the non-compatible HiveLocalStorage
is defined when depending on supabase_flutter
, but currently it is defined in the same local_storage.dart file as SharedPreferencesLocalStorage
, so those definitions would need to be put into separate files before that could work.
The only fix I can think of right now is to remove the HiveLocalStorage
from the supabase_flutter
package (therefore completely removing the dependency on hive) and then have developers using HiveLocalStorage
just copy and paste the class into their flutter project. I do see that this is not really an optimal solution, but currently supabase_flutter
prohibits anyone from using hive: 4.0.0
, which is also not optimal.
The only fix I can think of right now is to remove the HiveLocalStorage from the supabase_flutter package (therefore completely removing the dependency on hive) and then have developers using HiveLocalStorage just copy and paste the class into their flutter project.
Yeah, maybe it's about time to do this. It's not ideal to keep the hive dependency around anyway.
@Namli1 Just out of curiosity, what is the reason why you want to use hive 4.x-dev and not 2.x? Is it just because it's new?
@dshukertjr I mainly want to use the hive 4.x-dev version to save myself the trouble of migrating from hive 2.x to hive 4.x later on and as the hive 4.x is built on top of isar, there also seem to be a few performance improvements.
supabase_flutter
depends onhive: ^2.2.1
, but the newest version of the packagehive: ^4.0.0
. I would like to use that newer version in my project but as there have been some breaking changes,supabase_flutter
is incompatible withhive: ^4.0.0
. It seems like migrating from the older to the newer version of hive can be done by updating a few lines, the only problem is be that people still usinghive: ^2.2.1
would then in turn receive an incompatible error. So I wanted to ask how this dependency conflict can be resolved, maybe by either completely removing HiveLocalStorage, asSharedPreferencesLocalStorage
is the default local storage anyway or by movingHiveLocalStorage
out of the package so it won't cause a dependency conflict anymore. Any thoughts on this?