Skip to content

repl: fix multiline history editing string order #57874

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

puskin
Copy link
Contributor

@puskin puskin commented Apr 14, 2025

fixing an issue introduced in the last commit of #57400:
when editing a multiline history in REPL, the string gets reversed.

Added relevant automated tests

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. readline Issues and PRs related to the built-in readline module. labels Apr 14, 2025
Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this also fix the flaky behavior reported in the comment? :)

#57400 (comment)

Copy link

codecov bot commented Apr 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.24%. Comparing base (f89baf2) to head (03cd310).
Report is 297 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #57874      +/-   ##
==========================================
- Coverage   90.24%   90.24%   -0.01%     
==========================================
  Files         630      630              
  Lines      185670   185694      +24     
  Branches    36401    36404       +3     
==========================================
+ Hits       167567   167577      +10     
- Misses      10992    10999       +7     
- Partials     7111     7118       +7     
Files with missing lines Coverage Δ
lib/internal/readline/interface.js 96.79% <100.00%> (+0.01%) ⬆️

... and 37 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@puskin puskin force-pushed the repl-edit-multiline-reverse-strig branch from 50800d0 to 39b827c Compare April 14, 2025 16:05
@puskin
Copy link
Contributor Author

puskin commented Apr 14, 2025

Would this also fix the flaky behavior reported in the comment? :)

#57400 (comment)

I just added some code which could fix the flakiness... I am not sure if it is good / clean enough tho, I didn't have any cooler idea 😞

Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the wait should make a difference for the test being flaky. I could imagine we run tests in parallel that use the same repl file to write to and they conflict with each other. Or is that unique to the current tmp directory?

The flaky result said we had two history entries.

@puskin
Copy link
Contributor Author

puskin commented Apr 14, 2025

Yeah I interpreted the two history entries as in a weird combination of keypresses which were not properly "awaited" for. Unfortunately I cannot reproduce the issue, let me investigate the "multiple access to the same history file" path

EDIT: applied your suggestion, let's see if it happens again!

@puskin puskin force-pushed the repl-edit-multiline-reverse-strig branch from 39b827c to 4a9c482 Compare April 14, 2025 17:35
@BridgeAR BridgeAR added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 14, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 14, 2025
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@puskin puskin force-pushed the repl-edit-multiline-reverse-strig branch from 4a9c482 to 84f0885 Compare April 15, 2025 08:57
@puskin puskin force-pushed the repl-edit-multiline-reverse-strig branch from 84f0885 to 03cd310 Compare April 15, 2025 09:02
@BridgeAR BridgeAR added request-ci Add this label to start a Jenkins CI on a PR. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Apr 15, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 15, 2025
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@pmarchini pmarchini added the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 16, 2025
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 16, 2025
@nodejs-github-bot nodejs-github-bot merged commit af85f3f into nodejs:main Apr 16, 2025
63 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in af85f3f

RafaelGSS pushed a commit that referenced this pull request May 1, 2025
PR-URL: #57874
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
RafaelGSS pushed a commit that referenced this pull request May 2, 2025
PR-URL: #57874
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
aduh95 pushed a commit that referenced this pull request May 6, 2025
PR-URL: #57874
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
aduh95 pushed a commit that referenced this pull request May 6, 2025
PR-URL: #57874
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
RafaelGSS pushed a commit that referenced this pull request May 14, 2025
PR-URL: #57874
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
aduh95 pushed a commit that referenced this pull request May 16, 2025
PR-URL: #57874
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
aduh95 pushed a commit that referenced this pull request May 17, 2025
PR-URL: #57874
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
aduh95 pushed a commit that referenced this pull request May 17, 2025
PR-URL: #57874
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
aduh95 pushed a commit that referenced this pull request May 17, 2025
PR-URL: #57874
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@aduh95 aduh95 added the backport-requested-v22.x PRs awaiting manual backport to the v22.x-staging branch. label May 18, 2025
@aduh95
Copy link
Contributor

aduh95 commented May 18, 2025

test-repl-multiline-navigation is failing on Windows with this change and on v22.x-staging, it would require a manual backport if we want it on 22.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. backport-requested-v22.x PRs awaiting manual backport to the v22.x-staging branch. needs-ci PRs that need a full CI run. readline Issues and PRs related to the built-in readline module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants