Skip to content

Fix collaborative_editor_url incorrectly mapping trigger/edge s param to job#4593

Open
m4cd4r4 wants to merge 2 commits intoOpenFn:mainfrom
m4cd4r4:fix/collab-editor-param-mapping
Open

Fix collaborative_editor_url incorrectly mapping trigger/edge s param to job#4593
m4cd4r4 wants to merge 2 commits intoOpenFn:mainfrom
m4cd4r4:fix/collab-editor-param-mapping

Conversation

@m4cd4r4
Copy link
Copy Markdown

@m4cd4r4 m4cd4r4 commented Apr 1, 2026

Summary

Closes #4375

When a user switches from the legacy editor to the collaborative editor,
the s query param (selected node) is converted to the appropriate collab
param (job=, trigger=, or edge=). The conversion depends on
determine_selection_type/2, which pattern-matches on atom-keyed socket
assigns (selected_trigger, selected_job, selected_edge).

The bug: collaborative_editor_url/2 was passing the URL params map
(string-keyed) as the 4th argument to convert_param, not socket assigns.
Since the URL params never contain :selected_trigger etc., the cond always
fell through to the default "job" case - so triggers and edges were always
mapped to job= instead of trigger= or edge=.

Changes

  • collaborative_editor_url/3 now takes an optional assigns arg (defaults
    to %{} for backward compat) and passes it to convert_param instead of
    the URL params map
  • edit.ex now passes socket.assigns when calling collaborative_editor_url
    from the switch_to_collab_editor event handler
  • Three new tests cover the fixed trigger/edge/job resolution with assigns

Checklist

  • I have added tests to cover my changes
  • I have used an AI assistant (Claude Code) to help produce this code

…signs

When switching from legacy to collaborative editor, the s (selection) param
was always mapped to job= regardless of whether the selected item was a
trigger or edge. This happened because determine_selection_type/2 needs
atom-keyed socket assigns, but collaborative_editor_url/2 was passing the
string-keyed URL params map instead.

Adds an optional third assigns argument to collaborative_editor_url/3 and
passes socket.assigns from the handle_event caller in edit.ex.

Fixes OpenFn#4375
@github-project-automation github-project-automation bot moved this to New Issues in Core Apr 1, 2026
@m4cd4r4
Copy link
Copy Markdown
Author

m4cd4r4 commented Apr 1, 2026

The test_elixir failure is a pre-existing flaky test (sorting workflows by last_workorder_updated_at desc) unrelated to this change - it touches no workflow sorting code. The lint failure has been fixed in the latest push (line too long in edit.ex).

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

Labels

None yet

Projects

Status: New Issues

Development

Successfully merging this pull request may close these issues.

Map collab editor params to legacy editor

1 participant