[v4]: add synthetic arg to /click route stub#1884
Open
seanmcguire12 wants to merge 2 commits intomainfrom
Open
[v4]: add synthetic arg to /click route stub#1884seanmcguire12 wants to merge 2 commits intomainfrom
synthetic arg to /click route stub#1884seanmcguire12 wants to merge 2 commits intomainfrom
Conversation
|
synthetic arg to /click routesynthetic arg to /click route stub
Contributor
There was a problem hiding this comment.
No issues found across 3 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Architecture diagram
sequenceDiagram
participant Client
participant API as API Route (/v4/page/click)
participant Schema as Zod / OpenAPI Validation
participant Service as Page Service
Client->>API: POST /v4/page/click { selector, synthetic? }
API->>Schema: Validate request body
Note over Schema: NEW: Schema now includes "synthetic" (boolean, default false)
alt Invalid Payload
Schema-->>API: Validation Error
API-->>Client: 400 Bad Request
else Valid Payload
Schema-->>API: Parsed Params
API->>Service: click(params)
alt NEW: params.synthetic == true
Service->>Service: INTERNAL: route to sendClickEvent()
Note over Service: Dispatches a synthetic JS click event
else params.synthetic == false (default)
Service->>Service: Standard click() logic
Note over Service: Simulates trusted physical mouse interaction
end
Service-->>API: Action Result
API->>Schema: NEW: Map to PageClickActionOutput
Note over Schema: Output now includes synthetic flag in params metadata
Schema-->>API: Formatted Response
API-->>Client: 200 OK + Result
end
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.
why
/sendClickEventroutewhat changed
syntheticparameter to the/clickschema, which we will internally route to.sendClickEvent()screenshot:
test plan
synthetic: truepasses validationSummary by cubic
Add an optional synthetic flag to the v4 /click route to support synthetic click events through the same endpoint, defaulting to false for backward compatibility. Addresses Linear STG-1659.
synthetic?: boolean(default false) to/clickparams and routes synthetic clicks to sendClickEvent.packages/server-v4to includesyntheticin params and require it in action output params (with default false).synthetic: trueis accepted and succeeds.Written for commit b0bd197. Summary will update on new commits. Review in cubic