fix(test): re-read the active editor tab in GlobalSearch test 7 - #42129
Draft
wyattwalter wants to merge 1 commit into
Draft
fix(test): re-read the active editor tab in GlobalSearch test 7#42129wyattwalter wants to merge 1 commit into
wyattwalter wants to merge 1 commit into
Conversation
GlobalSearch_spec.js test 7 created an API from a datasource and then read
`.editor-tab.active .ads-v2-text` exactly once, through
agHelper.GetObjectName().invoke("text"). The read is not retried, so it
captured whatever the tab bar happened to be showing at that instant.
After POST /api/v1/actions the IDE does not swap the active tab atomically.
handleActionCreatedSaga pushes the new API route, but segmentMode only flips
Add -> Edit on the following commit of useCurrentEditorState, and the tab list
itself is only rewritten later still, by updateIDETabsOnRouteChangeSaga. For
that window AddTab is the active tab and its label is "New Query", so the
assertion read "New Query" and failed.
The active tab is now re-read until it settles on the new API. The route
carries editName=true, which mounts the tab in rename mode where ADS Text
renders an input instead of a text node, so the name is taken from data-value
when it is present and from the text node otherwise.
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
|
This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected. |
Contributor
|
Warning Your free Security trial is over. An organization admin can activate billing to continue. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
GlobalSearch_spec.jstest 7 ("Api actions should have API as prefix") creates an APIfrom a datasource and then reads the active editor tab exactly once:
GetObjectName()iscy.get(".editor-tab.active .ads-v2-text").invoke("text"). Becausethe value is consumed in a
.then(), the read is never retried — the assertion seeswhatever the tab bar happened to render at that instant.
The tab swap after
POST /api/v1/actionsis not atomic:handleActionCreatedSaga(app/client/src/sagas/ApiPaneSagas.ts) pushes the new APIroute with
editName=true.segmentModeonly flipsAdd->Editon the next commit ofuseCurrentEditorState,so on the render right after the push,
AddTabis still the active tab.updateIDETabsOnRouteChangeSaga(
app/client/src/sagas/IDESaga.tsx) viaSET_IDE_QUERIES_TABS.AddTab(app/client/src/pages/AppIDE/layouts/components/EditorTabs/AddTab.tsx) labelsitself
New ${segmentName}, so inside that window the active tab reads "New Query" —which is exactly the value the failures report.
This PR re-reads the active tab until it settles on the new API. The route carries
editName=true, which mounts the tab in rename mode, and in that state ADSTextrendersan input rather than a text node (
app/client/packages/design-system/ads/src/Text/Text.tsx)— so the name is taken from
data-valuewhen present and from the text node otherwise.Both states are covered, and the assertion retries through the whole transition.
Evidence
Mined from the last 12
test-build-docker-imageruns onappsmithorg/appsmith-ee(10 parsed, 600 shard logs) with
.cursor/skills/cypress-flake-report:Regression/ClientSide/OtherUIFeatures/GlobalSearch_spec.js— 4 retry events in 4 of 10runs, all recovered on retry, i.e. invisible in the run status.
Two distinct signatures, both in test 7. This PR fixes the tab-name one:
assert expected New Query to include Apiassert expected New Query to include ApiShard 47 in both, position 4 in the lineup, spec passed on the automatic retry. The
2026-08-14 command log shows the ordering directly — the failed assertion is logged
before
new url .../edit/api/<id>?a=b&editName=true&from=datasources, so the readhappened while the editor was still routed to the add-new tab.
The other signature in that spec (
data-selectedon the sidebar Editor button, runs31568260858 / 31625953107 / 31688250922) is a separate race in
Sidebar.navigateand isdeliberately not touched here — that helper is called by hundreds of specs and the
mechanism is not yet proven.
Impact on existing instances
None. Test-only change, one spec file, no product code and no CI configuration.
Type of change
Testing
Full Cypress suite via the automation command below. The change makes an existing
assertion auto-retrying; it does not weaken it — a tab that never reaches a name
containing
Apistill fails.Automation
/ok-to-test tags="@tag.All"
Tracking: https://linear.app/appsmith/issue/APP-15705
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/31799791927
Commit: ad47fe7
Cypress dashboard.
Tags:
@tag.AllSpec:
Fri, 14 Aug 2026 13:33:37 UTC