IO-Design-Team / hive_ce

Hive Community Edition - A spiritual continuation of Hive v2
https://pub.dev/packages/hive_ce
Apache License 2.0
30 stars 2 forks source link

Fix warning to show only if it needs #12

Closed LucazzP closed 3 months ago

Rexios80 commented 3 months ago

Please provide more details on what this change does and why it is needed

codecov-commenter commented 3 months ago

Welcome to Codecov :tada:

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered :open_umbrella:

Rexios80 commented 3 months ago

The reason I added that warning is because override WILL NOT actually override an adapter for the same type unless the typeIds are the same. Are you sure your code isn't exhibiting the behavior that this warning is trying to prevent.

LucazzP commented 3 months ago

Actually, I don't know, the problem I'm getting is because I'm using my own DateTimeAdapter, but hive has their own DateTimeAdapter, so I want to override it to use my own adapter. On the original Hive version I was not getting this warning, even without the override. So I realized that you added this Warning. So I thought that the solution should be adding the override as true when adding my adapter. So what should I do to reach to my objective, that is use my DateTimeAdapter instead of the Hive one? We could also improve that Warning message to direct the developer to a way to fix that, to be easier to understand the actions.

Rexios80 commented 3 months ago

You are right the warning is showing when it doesn't need to, but your proposed fix will hide the warning in legitimate cases. Can you try https://github.com/IO-Design-Team/hive_ce/pull/13 and see if it fixes your issue?

LucazzP commented 3 months ago

Great, now it worked, I changed my adapter type id to be the same that you printed with this warning and the warning was gone, so it solved! Thank you for the quick solution!