From 8acc99d88527a9dfecf7ebceb858f344819d10c3 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Wed, 3 Jun 2026 00:11:25 -0500 Subject: fix(views): rebuild Linear view URLs instead of querying the missing url field Linear's CustomView type has no url field. Three GraphQL selections requested it (the custom-views list query and both the create and update mutation payloads), so each of those requests returned HTTP 400 and pearl got nil back. Running a Linear view came up with an empty picker, and publishing or updating a local view to Linear failed silently. The test suite stayed green because the view tests mocked a url field the real API never returns. I dropped url from all three selections. The workspace urlKey is now fetched once and cached, and a view's web URL is rebuilt as https://linear.app//view/, the shape Linear's own favorite URLs use (the full view UUID, not the slug id). pearl-open-current-view-in-linear keeps working, and when the urlKey is unavailable it degrades to nil so the link builder can't throw. That also stops a urlKey hiccup right after a successful publish from aborting the record step and orphaning the new view. I added regression locks asserting neither the list query nor the mutation payload selection requests url, since the field name is the schema contract that broke. --- tests/test-pearl-saved-query-sync.el | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/test-pearl-saved-query-sync.el') diff --git a/tests/test-pearl-saved-query-sync.el b/tests/test-pearl-saved-query-sync.el index 534993e..91a7061 100644 --- a/tests/test-pearl-saved-query-sync.el +++ b/tests/test-pearl-saved-query-sync.el @@ -199,6 +199,12 @@ label, plist team-id nil + team-name \"Personal\" + shared nil." ;;; pearl--customview-create-async +(ert-deftest test-pearl-customview-payload-fields-omit-url () + "The mutation payload selection must not request the unsupported `url' field. +Linear's `CustomView' has no `url'; selecting it 400s the create/update and +silently fails the publish (the 2026-06-02 regression)." + (should-not (string-match-p "\\burl\\b" pearl--customview-payload-fields))) + (ert-deftest test-pearl-customview-create-async-success () "A successful `customViewCreate' invokes the callback with `:success' t and the view." (testutil-linear-with-response @@ -459,6 +465,7 @@ erased on every re-sync." ((symbol-function 'pearl--progress) (lambda (&rest _) nil)) ((symbol-function 'message) (lambda (&rest _) nil)) ((symbol-function 'customize-save-variable) (lambda (_ _) nil)) + ((symbol-function 'pearl--org-url-key) (lambda (&optional _) "deepsat")) ((symbol-function 'pearl--customview-update-async) (lambda (_view-id input cb) (setq captured-input input) -- cgit v1.2.3