You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sync() should handle flow sequences gracefully #31
Currently, sync() raises PatchError when trying to insert into a flow sequence (e.g. repos: []). This forces callers to wrap sync() in a try/except and fall back to upsert():
Proposal: When sync() needs to insert into an empty flow sequence, it should convert the node to a block sequence automatically. An empty flow sequence ([]) has no formatting worth preserving, so this is always the correct thing to do.
For non-empty flow sequences where patching fails, falling back to a full replacement (like upsert) internally would also be reasonable.
This would let callers use sync() unconditionally without needing to handle PatchError.
Activity