Skip to content

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

Open
tgrosinger wants to merge 1 commit into
callumalpass:mainfrom
tgrosinger:fix/put-empty-array-clearing
Open

Clear contexts and blockedBy on empty-array updates#2221
tgrosinger wants to merge 1 commit 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.

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.
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.

1 participant