core
core copied to clipboard
Mix of filter in google calendar
The problem
Hello
There is a problem with the latest version of HA for Google Calendar integration.
In the exemple, i filter message "Nettoyage" and in the entity it use an another filter ("Coupure chauffage")

What version of Home Assistant Core has the issue?
2022.11.1
What was the last working version of Home Assistant Core?
2022.10.x
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Google calendar
Link to integration documentation on our website
https://www.home-assistant.io/integrations/google/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response
Hey there @allenporter, mind taking a look at this issue as it has been labeled with an integration (google
) you are listed as a code owner for? Thanks!
Code owner commands
Code owners of google
can trigger bot actions by commenting:
-
@home-assistant close
Closes the issue. -
@home-assistant rename Awesome new title
Change the title of the issue. -
@home-assistant reopen
Reopen the issue. -
@home-assistant unassign google
Removes the current integration label and assignees on the issue, add the integration domain after the command.
(message by CodeOwnersMention)
google documentation google source (message by IssueLinks)
Duplicate with https://github.com/home-assistant/core/issues/81533


Can confirm this for an older yaml based configuration.
Thank you for the report. There was a large rewrite of parts of calendar in this release, so likely the source of the bug.
I am not yet able to reproduce this, however.
I have a yaml entry like this:
- cal_id: [email protected]
entities:
- device_id: device_automations
name: Device Automations
- device_id: backyard_light
name: Backyard Light
search: "#Backyard"
- device_id: ext_plug
name: Exterior Plug
search: "#ExtPlug"
- device_id: plug
name: Plug
search: "#Plug"
And all the events show up as appropriate.

There is some persistent state now stored in .config/storage/google.XXXX
that serves the calendar and so i am wondering if the data in that file was corrupted in a race condition, or its something we can reproduce consistently.

maybe helpful addition: future entries are displayed correctly in the calendar view, only the current/next event seems to be mixed up somehow.
Thanks for your reply
I have a yaml entry like this:
My yaml looks very similar to yours :
- cal_id: [email protected]
entities:
- device_id: télétravail
name: Télétravail
search: "#Télétravail"
- device_id: poubelle_verte
name: Poubelle verte
search: "#verte !!-960"
- device_id: poubelle_jaune
name: Poubelle jaune
search: "#jaune !!-600"
However could char "é" (and other french chars) can be part of the problem ?
Will look at config/storage/google.XXXX
as soon as i can connect to SSH
@allenporter
There is some persistent state now stored in
.config/storage/google.XXXX
that serves the calendar and so i am wondering if the data in that file was corrupted in a race condition, or its something we can reproduce consistently.
Found several duplications inside. So i renamed files, and sync from the UI. Files are recreated and calendars are correct now
Oh interesting!
I worry there is a bug where things may be written out of order and mixed up on different objects. I will investigate adding some locking if we're doing async io while reading/writing data.
EDITED: I also deleted the google.xxx file in .storage and reloaded.
Just a quick “me too” comment… nothing to add than I’m another one with the problem.
I removed and the put back the YAML file and reloaded each time; worked for a time but recorrupted.
But I’ll look into the .storage bit too.
I had the same problem and could fix this by deleting the google.
Although in my case the path is /config/.storage/
Hi @allenporter I am not trying to pressure you or complain; this is info-only but the deletion of the google.xxxx file in .storage.xxxxx, followed by a reload is a functioning work-around. But I need to do it a few times a day, if that gives you any more info.
(Edited for bad typing on iPhone while wife was driving in traffic)
@traindriverrev yeah, this is a huge issue that needs to be fixed, this is not an "ok" workaround. I was just looking at it and its a priority to fix.
If someone has an account w/ data that isn't too sensitive, you can email me your google.XXX storage file at [email protected] and it may help me diagnose the issue. Definitely don't do this if you have PII you're concerned with sharing.
I can think of a hack where i make a separate file for each calendar, but i'd like to understand where the race and data mix-up is happening. It should be sharing a single file, but with separate keys in the storage file for each calendar.
@traindriverrev yeah, this is a huge issue that needs to be fixed, this is not an "ok" workaround. I was just looking at it and its a priority to fix.
Hi @allenporter - all good! I was just trying to indicate an acknowledgement that this is a volunteer-driven open-source project where fixes aren't able to be 'expected' in a timeframe a commercial project might give (although reality is that it's probably more agile as a result).
I'd offer to help but it's a bit above my pay grade and you seem to have homed in on the problem.
I'll email you my google. file - it's not too sensitive. Just don't judge the 'weirdness' of the entries!
If someone has an account w/ data that isn't too sensitive, you can email me your google.XXX storage file at [email protected] and it may help me diagnose the issue. Definitely don't do this if you have PII you're concerned with sharing.
Done!
I worry there is a bug where things may be written out of order and mixed up on different objects. I will investigate adding some locking if we're doing async io while reading/writing data.
Hello @allenporter I may have found a way to reproduce it by editing calendar (recurring event) from Google Agenda : then at next synch duplicate are created again
additional info: my calendar was fine for a few days after deleting google.xxxxxxx - seems it mixed up again today as soon as the offset_reached attribute for the next event in one of the calendars turned true.
Someone sent me one of their corrupted files and it reads like the event was added to the wrong calendar when stored. I don't yet know the cause, but can take it from here. Thanks for the reports folks.
I was able to reproduce the issue by having multiple search for the same calendar. The bug is in the google calendar API as it returns the same sync token for all searches, even if they are different, violating the contract of the API.
I am going to have to revert the use of local sync for anything involving search, which is unfortunate. I'll work on making a duplicate code path for search.