event_sync to read ISO from updated Fulcrum API #289
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As per discussion on Discord, syncing of events results in the current events being off by 1 hour 1 minute, due to the replacing of
tzinfoviapytzeffectively applying the historical LMT offset (1m15s, rounded down to 1m bypytz).This PR changes conversion of the datetime strings received from the Fulcrum API to parse them directly as ISO-8601 strings. This will require the merging and deployment of my PR to Fulcrum, else it will fail, as the current Fulcrum API provides only naive datetime strings.
The PR to Fulcrum will change the API to provide these tz-aware datetime strings consistently. In my experimentation with both projects' codebases for the first time, and a problem I'll admit I thought couldn't get more cursed when I last had to deal with it over 3 years ago, I tried a few different approaches with both Apollo and Fulcrum locally, including the usage of
.localize. I opted to leave theLONDONremnants of this in here since it does reduce (the albeit very mild) redundancy seen previously - similar patterns occur elsewhere in the project too.This will be intentionally left as a draft until after I eep and make the Fulcrum PR.