diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-28 10:15:54 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-28 10:15:54 -0500 |
| commit | 7939a598bc1f2e045dd4d4fe9e5dc4b7437147d5 (patch) | |
| tree | bcbee40446999e8bf9f403196b401139217e7173 /tests/run-coverage-file.el | |
| parent | fc57dcac9a7c972fa59dbd0aded06ae0725000ca (diff) | |
| download | pearl-7939a598bc1f2e045dd4d4fe9e5dc4b7437147d5.tar.gz pearl-7939a598bc1f2e045dd4d4fe9e5dc4b7437147d5.zip | |
fix(view-sync): refuse sync of a saved query whose filter is empty
A saved query with no filter constraints compiled to nil via pearl--build-issue-filter. The sync command then passed (cons "filterData" nil) to customViewCreate, which JSON-encoded as filterData=null. Linear's CustomViewCreateInput.filterData expects a JSON object, so the API rejected with an opaque error message after the user had already clicked through the scope picker.
I added an early refusal in pearl-sync-saved-query-to-linear: when filter-data is nil, signal a user-error naming what's wrong before the scope prompt fires. The message tells the user to add a constraint and re-sync rather than leaving them to puzzle out an opaque API rejection.
I restructured the let* nesting to put the empty-filter check between the bindings (where filter-data is computed) and the scope prompt (where the user is asked to pick a destination). The scope binding moved out of the outer let* into an inner let so it doesn't evaluate until after the filter-data guard runs.
Two tests cover the guard. The first-time-sync test (no :linear-view-id on the entry) asserts neither the scope prompt nor customViewCreate fires. The re-sync test (entry has :linear-view-id) asserts customViewUpdate doesn't fire either. The re-sync test guards against a future refactor accidentally hoisting the check into the create-only branch. All 663 ert tests pass. make compile and make lint are clean.
Diffstat (limited to 'tests/run-coverage-file.el')
0 files changed, 0 insertions, 0 deletions
