CS3219-AY2425S1 / cs3219-ay2425s1-project-g36

nus-cs3219-ay2425s1-cs3219-ay2425s1-project-project-template created by GitHub Classroom
MIT License
0 stars 5 forks source link

[BUG] Collaboration frontend get empty code string response when getting code from backend #117

Closed larrywang0701 closed 3 weeks ago

larrywang0701 commented 4 weeks ago

Steps to reproduce:

Behaviors:

Sometimes the bug happens...

image (also matchedUser is null, maybe another bug from the backend)

Sometimes it works without the bug...

image

To clarify why I think the bug of empty code editor may comes from the collaboration backend:

image When navigating back/reopening collaboration page, for the debug output on line 106, sometimes there will be a code: output at browser's console. Executing the debug output line at 106 means that load-document signal from the backend is received by the frontend through WebSocket, but with empty code string in the payload. So I think since the signal itself contains empty code string, and frontend sent the get-document signal and received the load-document signal successfully, I guess the bug may actually comes from the backend.

brein62 commented 4 weeks ago

another bug (since you're fixing bugs here): when you exit out to another page, the content for both the chat and the code window resets as well.

Two ways (but i think they're both the same bug):

First way

Match User A with User B, resulting in collab page User A clicks on "Practise an Interview" Text for User A is blank now (code editor + message screen) Second way

Match User A with User B, resulting in collab page User A clicks on "PeerPrep" logo on top left User A goes back to collab page by clicking on "Practise an Interview" Text for User A is blank now (code editor + message screen)

brein62 commented 4 weeks ago

For the bug, I tried to fix by frontend side by adding a retry mechanism on loading (initial) code to editor, but I found that sometimes the frontend can correctly load code from the backend (after I navigate away and back or clicking Practise an Interview), but sometimes the bug still happens and from debug console I found that the code responsed from the backend is empty strings. Maybe this is a backend-side bug, so please let the people who are responsible for the collaboration backend to consider this bug from the backend, since I really don't know why frontend sometimes received empty code strings from load-document sent by the backend but sometimes not. Thanks!

(Since after I found that the frontend received load-document messages from backend with empty code strings for sometimes (and sometimes it works), now I think that the bug may actually in collaboration backend, not frontend. So maybe can let the people who are responsible for the collaboration backend to also check the bug later in backend.)

wjayee commented 3 weeks ago

For zihan's bug, its because of the implementation and isnt really a bug. The save interval was set to 2 seconds which causes the empty code returned since its not saved yet. I'll js lower the interval to 1 second i think its the same for brendan too

brein62 commented 3 weeks ago

it was a different issue entirely but this is still another bug to consider

doesnt take place for me tho