Skip to content

Conversation

@RohitR311
Copy link
Collaborator

@RohitR311 RohitR311 commented Nov 13, 2025

What this PR does?

Prevents replication of capture list data in capture text that was observed in certain sites.

Screenshot 2025-11-13 at 12 22 32 PM

Summary by CodeRabbit

  • New Features

    • Added new recording interpretation capability for workflows
  • Improvements

    • Enhanced data processing and payload handling in workflow execution for improved consistency and accuracy

@RohitR311 RohitR311 added the Type: Bug Something isn't working label Nov 13, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 13, 2025

Walkthrough

Refactored the serializableCallback flow in Interpreter to use explicit action types and names for deriving and flattening data subtrees. Updated binaryCallback signature in editor mode and added logic to assemble structured results with separate output categories (scrapeSchemaOutput, scrapeListOutput, binaryOutput). Added public InterpretRecording method to WorkflowInterpreter.

Changes

Cohort / File(s) Summary
Interpreter callback refactoring and output handling
server/src/workflow-management/classes/Interpreter.ts
Reworked serializableCallback to derive data subtrees via currentActionType/currentActionName and flatten using explicit paths (data.scrapeList or data.scrapeSchema). Updated binaryCallback signature to accept { name, data, mimeType } with base64 encoding. Modified editor mode to emit callbacks with actionName and typeKey, flush persistence, and return structured results with separate scrapeSchemaOutput, scrapeListOutput, and binaryOutput fields. Added public InterpretRecording method.

Sequence Diagram(s)

sequenceDiagram
    participant Editor as Editor Mode
    participant Interp as Interpreter
    participant Persist as Persistence
    
    Editor->>Interp: interpreter.run()
    activate Interp
    
    alt scrapeSchema action
        Interp->>Interp: currentActionType = 'scrapeSchema'<br/>Flatten data.scrapeSchema via Object.values()
        Interp->>Editor: serializableCallback({name, data, typeKey})
    else scrapeList action
        Interp->>Interp: currentActionType = 'scrapeList'<br/>Flatten data.scrapeList via Object.values()
        Interp->>Editor: serializableCallback({name, data, typeKey})
    else screenshot action
        Interp->>Interp: base64-encode data
        Interp->>Editor: binaryCallback({name, data, mimeType})
    end
    
    deactivate Interp
    
    Interp->>Persist: Flush persistence
    Interp->>Interp: Assemble structured result
    Interp->>Editor: Return {scrapeSchemaOutput, scrapeListOutput, binaryOutput}
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

  • Key areas requiring extra attention:
    • Callback flow logic changes (serializableCallback and binaryCallback) — verify correct data type derivation and flattening across different action types
    • Editor mode output assembly and persistence flushing — ensure all output categories are populated correctly and no data loss occurs
    • Error handling paths in updated callback signatures — confirm error logging messages are consistent and informative
    • New InterpretRecording public method — verify method signature, return type, and integration with existing workflow execution paths

Suggested reviewers

  • amhsirak

Poem

🐰 A rabbit hops through data flows so bright,
Callbacks flatten true from left to right,
With scrapeSchema, scrapeList held tight,
And screenshots encoded in binary light—
The interpreter now dances with delight! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'fix: capture text data replicated' is vague and does not clearly convey the specific technical changes made to the serialization callback flow and action handling in the Interpreter class. Consider using a more specific title that describes the actual fix, such as 'fix: prevent scrape list data replication into scrape schema' or 'fix: refactor serializableCallback to use explicit action types for proper data flattening'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch replica-fix

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 69ad028 and c20f3fb.

📒 Files selected for processing (1)
  • server/src/workflow-management/classes/Interpreter.ts (2 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@amhsirak amhsirak merged commit 71c39b1 into develop Nov 20, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants