fix: backfill Todoist labels when incremental sync returns empty#2304
Closed
Blacksuan19 wants to merge 1 commit intoalainm23:mainfrom
Closed
fix: backfill Todoist labels when incremental sync returns empty#2304Blacksuan19 wants to merge 1 commit intoalainm23:mainfrom
Blacksuan19 wants to merge 1 commit intoalainm23:mainfrom
Conversation
Some Todoist accounts can return an empty `labels` collection during incremental sync, which leaves Planify with missing local labels even though labels exist server-side. This change adds a one-time per-source labels backfill: - when delta sync returns no labels, request `resource_types=["labels"]` with `sync_token=*` - merge the returned labels into the local store - keep normal incremental sync unchanged Also hardens item label resolution by: - resolving labels by id first, then by name - skipping unresolved labels safely to avoid null label entries Result: - labels created outside Planify are loaded correctly - labels appear on tasks and in label pickers after sync - normal label create/update flows continue to work Signed-off-by: blacksuan19 <abubakaryagob@gmail.com>
Contributor
|
Translation files need updating
|
byquanton
reviewed
Mar 12, 2026
Collaborator
byquanton
left a comment
There was a problem hiding this comment.
This looks like a very hacky way to fetch labels once per runtime during synchronisation. It also shouldn't be necessary to make an extra request just for the labels.
Author
|
removing and adding account again fixed label sync, closing this now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes an issue where Todoist labels could be missing in Planify if incremental sync returned an empty
labelspayload.What changed
Services.Todoist.sync():sync_token=*resource_types=["labels"]Objects.Item:Why
On some accounts, incremental sync can omit label entries even when labels exist server-side. Without a full labels refresh, Planify never repopulates missing labels.
Validation
ninja -C buildninja -C build test(all passing)Testing
Manual end-to-end validation against a real Todoist account:
Result: all label create/update/delete flows worked as expected in both directions.
Related