Skip to content

Clear contexts and blockedBy on empty-array updates - #2221

Merged
callumalpass merged 2 commits into
callumalpass:mainfrom
tgrosinger:fix/put-empty-array-clearing
Aug 21, 2026
Merged

Clear contexts and blockedBy on empty-array updates#2221
callumalpass merged 2 commits into
callumalpass:mainfrom
tgrosinger:fix/put-empty-array-clearing

Conversation

@tgrosinger

@tgrosinger tgrosinger commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

The frontmatter deletion pass in removeUnsetMappedFields only removed the contexts and blockedBy keys when the update held a literal undefined, which JSON cannot express. HTTP clients sending PUT {"contexts": []} or PUT {"blockedBy": []} therefore got a 200 with the previous value silently left in place. Use the same hasOwnProperty plus empty-array deletion pattern that projects and reminders already use.

tgrosinger and others added 2 commits August 11, 2026 08:36
The frontmatter deletion pass in removeUnsetMappedFields only removed
the contexts and blockedBy keys when the update held a literal
undefined, which JSON cannot express. HTTP clients sending
PUT {"contexts": []} or {"blockedBy": []} therefore got a 200 with
the previous value silently left in place. Use the same hasOwnProperty
plus empty-array deletion pattern that projects and reminders already
use.
@callumalpass
callumalpass merged commit 8e1476c into callumalpass:main Aug 21, 2026
2 checks passed
@tgrosinger

Copy link
Copy Markdown
Contributor Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants