-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Content Provider returning null
when trying to insert new calendars
#129
Comments
Strange, it works here on my real device as well as in the Android 12 emulator… |
The issue comes from the ID, there seems to be an issue with new credentials. If I manually change the id of the calendar from |
Do you have steps to reproduce so that I can give a try? |
I'm not sure how to reproduce, started popping up after doing a fresh install of the app. There must be an issue with the Android's db. Maybe removing the ICS account from the system settings, and then uninstalling and reinstalling the app makes it pop up. I've opened #130, which creates the subscription without ID, and then updates the Room DB with the ID generated by the system. This fixed the issue for me, but maybe it's a bit dirty... |
Can't reproduce it with a fresh install:
→ Calendar is refreshed |
I'm happy to do some testing to report back. Let me know when I can download a new version to try (I am btw using Android 11). |
@Brog33 can you go to system settings > Accounts, and remove the ICSx⁵ account? Then wipe the app data of ICSx⁵, add the subscription back, and try to synchronize |
I also can't reproduce on a clean emulator... |
I noticed that ICSx5 provider in the android account settings does not have calendar sync enabled by default, so I need to manually set the permission (this seem to be separate from the calendar grant to the app itself). Okay. App+account wiped & subscription added back. When I manually sync (swipe down) the spinner flashes in an erratic manner until I navigate out from the app and back in. Then the spinner has stopped and it says "not synchronized yet" (Reproduced this 3 times now). 23-02-27-12-04-48.mp4 |
I'm not able to reproduce on other devices anymore, but it's happening on my personal phone. There's definetely an issue with the ID, with Logcat I have found:
|
I can only think of #130 to fix it. Uninstall and reinstall doesn't fix it. |
Maybe the calendar ID belongs to another account/app, so that ICSx⁵ doesn't see it, but it's of course anyway not possible to create the calendar with that ID? So steps would be:
Is that possible? |
Yup, that's the issue |
I was thinking that maybe the issue is that Google Calendar is the first calendar registered in the system, and that's why ID 1 is in use. That would also explain why I was having issues with the first emulator but not after wiping. I had my Google account loaded on the emulator, but after wiping it got logged out. |
Hm so what would you suggest? |
The "safest" option would be:
It's a bit dirty, but I think it's the safest way to make sure there are no conflicts, just let the system assign IDs. |
Yes, the calendar ID should be independent of the subscription ID. So the question is: do we want to put the calendar ID into the Subscriptions table or do we want to put the subscription ID into the Calendar, for instance into a sync column? I think it's better to put the subscription ID into the calendar because the calendar is dependent of the subscription (managed by the subscription) and not the other way. Doesn't sound dirty to me. |
Then, do you suggest adding an extra column to the subscriptions table? Or doing this? I think a new column is a bit overkill |
That would again create an implied correlation between the Subscription ID and the calendar ID. Maybe PRIMARY KEY doesn't work as expected in one special case, then this would fail, too. I'd make the correlation explicit. We should have either
When deciding this we have to take into account that system calendars may be not available anymore (for instance when a backup is restored). When for instance have in our db:
and then the system is reset, and other apps create 23 calendars, the assignment won't be correct anymore. If we would save the subscription ID in a CAL_SYNC column, the advantage would be that the ID would only be here when the calendar is actually available. (Of course, it could become incorrect through mechanisms like "Reset ICSx⁵ storage", which would reset our DB but keep the system calendars.) So we have to deal with those cases somehow. |
I think we should add the calendar id to the subscription, and not to the calendar through a In any case, if the data of the app is wiped, but not the calendar, the next synchronization of ICSx⁵ would add the subscription back just like in the migration process. If the other thing occurs, simply the calendar will be created again. I think that using the |
Yeah, probably… let's try with the calendar id in the subscription table! |
Currently synchronization is not working, the system is not allowing to create the calendars in the system. Logs:
The text was updated successfully, but these errors were encountered: