Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Monaco undo affects other user #397

Open
adamjimenez opened this issue Jun 19, 2021 · 10 comments · May be fixed by #398
Open

Monaco undo affects other user #397

adamjimenez opened this issue Jun 19, 2021 · 10 comments · May be fixed by #398

Comments

@adamjimenez
Copy link
Contributor

When a user presses undo it also undoes changes made by the other user.

Steps:

  1. User A types something
  2. User B types something
  3. User A press undo

Expected behaviour (as seen in ACE):

User A's change is undone.

Actual behaviour:

User A and User B's changes are undone.

CC'ing the monaco guys:
@zach-karat @Progyan1997

adamjimenez added a commit to adamjimenez/firepad that referenced this issue Jun 19, 2021
@adamjimenez adamjimenez linked a pull request Jun 19, 2021 that will close this issue
@0xTheProDev
Copy link
Contributor

0xTheProDev commented Jun 24, 2021

@adamjimenez Hey, will it be too much to ask you to create a small implementation of what you're doing, so that I can validate and debug?
I am unable to reproduce this on my own (I might have some custom setup).

@adamjimenez
Copy link
Contributor Author

I didn't think I was doing anything out of the ordinary. I'm using Monaco editor 0.25.2.
It would be handy if firepad.io had a Monaco demo like it does for the other editors.
I'll setup a demo when I get a min.

@0xTheProDev
Copy link
Contributor

@adamjimenez Hey, I just did a setup with 0.25.2 and does not seem to happen with me. I tried out with my custom version of Firepad, @hackerrank/firepad as well. Can you try if both of them reproduces this?

@adamjimenez
Copy link
Contributor Author

@Progyan1997 I tried the monaco example in the firepad demo and can replicate the issue as described. (see attached video)
I couldn't run the hackerrank version missing: examples/firepad.js

Desktop.2021.06.27.-.19.45.59.01.mp4

@0xTheProDev
Copy link
Contributor

I couldn't run the hackerrank version missing

Hey, you have to run using yarn start after installing deps using yarn 😅 firepad.js is built on-demand using dev-server.

@0xTheProDev
Copy link
Contributor

I tried the monaco example in the firepad demo and can replicate the issue as described.

Just to be sure, can you print firepad.firebaseAdapter_.userId_ in both sessions?

@adamjimenez
Copy link
Contributor Author

I tried the monaco example in the firepad demo and can replicate the issue as described.

Just to be sure, can you print firepad.firebaseAdapter_.userId_ in both sessions?

It's actually editor.firepad.firebaseAdapter_.userId_
And the two resultant strings are different.

@adamjimenez
Copy link
Contributor Author

I couldn't run the hackerrank version missing

Hey, you have to run using yarn start after installing deps using yarn 😅 firepad.js is built on-demand using dev-server.

I get a build error

  z.vcxproj -> C:\Users\Adam\Documents\GitHub\Firepad-fork\node_modules\grpc\build\Release\\libz.lib
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe` failed with ex
it code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:
23)
gyp ERR! stack     at ChildProcess.emit (events.js:376:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Windows_NT 10.0.19043
gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\n
ode-gyp\\bin\\node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=C:\\Users\\Adam\\Documents\\GitHub\
\Firepad-fork\\node_modules\\grpc\\src\\node\\extension_binary\\node-v83-win32-ia32-unknown\\grpc_node.node" "--module_name=grpc_
node" "--module_path=C:\\Users\\Adam\\Documents\\GitHub\\Firepad-fork\\node_modules\\grpc\\src\\node\\extension_binary\\node-v83-
win32-ia32-unknown" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83"
gyp ERR! cwd C:\Users\Adam\Documents\GitHub\Firepad-fork\node_modules\grpc
gyp ERR! node -v v14.17.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd build --fallback-to-build --library=static_library --module=C:\Use
rs\Adam\Documents\GitHub\Firepad-fork\node_modules\grpc\src\node\extension_binary\node-v83-win32-ia32-unknown\grpc_node.node --mo
dule_name=grpc_node --module_path=C:\Users\Adam\Documents\GitHub\Firepad-fork\node_modules\grpc\src\node\extension_binary\node-v8
3-win32-ia32-unknown --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\Adam\Documents\GitHub\Firepad-fork\node_modules\node-pre-gyp\li
b\util\compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:376:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1055:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
node-pre-gyp ERR! System Windows_NT 10.0.19043
node-pre-gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\Adam\\Documents\\GitHub\\Firepad-fork\\node_mod
ules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd C:\Users\Adam\Documents\GitHub\Firepad-fork\node_modules\grpc
node-pre-gyp ERR! node -v v14.17.0
node-pre-gyp ERR! node-pre-gyp -v v0.14.0
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp.cmd build --fallback-to-build --library=static_library --module=C:\Users\Adam\Documents\GitHub\Firepa
d-fork\node_modules\grpc\src\node\extension_binary\node-v83-win32-ia32-unknown\grpc_node.node --module_name=grpc_node --module_pa

@0xTheProDev
Copy link
Contributor

@nicolasnoble Can you shed some light on the above error?

@pawansingh00
Copy link

Hi,
was this undo issue solved?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants