Skip to content
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

aem2doc parsing now done in da-collab #163

Merged
merged 4 commits into from
May 28, 2024
Merged

aem2doc parsing now done in da-collab #163

merged 4 commits into from
May 28, 2024

Conversation

bosschaert
Copy link
Contributor

Also cleans up old websockets on navigation

Description

da-collab now does its own aem2doc and vice versa parsing. This PR is to accommodate this on the client side.

It also contains a bugfix to close the current websocket if the client navigates to a different document.

Related Issue

This is the client-side change for
adobe/da-collab#38

How Has This Been Tested?

  • Locally with da-collab and da-admin
  • Unit tests

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@bosschaert bosschaert requested a review from auniverseaway May 24, 2024 10:32
Copy link

aem-code-sync bot commented May 24, 2024

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run PSI checks
  • Re-sync branch
Commits

@bosschaert bosschaert changed the title Remove the aem2prose handling aem2doc parsing now done in da-collab May 24, 2024
Also cleans up old websockets on navigation
@bosschaert
Copy link
Contributor Author

The Playwright tests should start parsing once adobe/da-collab#38 is merged.

@@ -72,6 +84,7 @@ export default class DaEditor extends LitElement {

updated(props) {
if (!this._imsLoaded) return;
this.disconnectWebsocket();
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand why this is here, but I guess @bosschaert and @karlpauls you both do?

I will probably try to do some collab tests with multiple users as that is something I haven't done yet.

Copy link
Member

Choose a reason for hiding this comment

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

The way I read this is that the websocket will be disconnected for every update... and that seems a little worrisome / noisy.

Copy link
Contributor Author

@bosschaert bosschaert May 27, 2024

Choose a reason for hiding this comment

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

What we were seeing was that when you move to a different document (for example by typing the doc name in the browser location bar), that connections to the previous document were still going on because the websocket wasn't closed. This caused errors in the log, but also (potentially a lot of) unnecessary websocket communication.

IIRC this is because the document URL didn't change ( http://localhost:3000/edit#/da-sites/da-status/bosschae/doc1 vs http://localhost:3000/edit#/da-sites/da-status/bosschae/doc2 ) is really just an anchor change, the location is still the same.

So, no the websocket won't get disconnected for every update, but it will get disconnected when the anchor is updated, i.e. we're moving to a different document.

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, I think @auniverseaway is correct - this looks wrong. It should only disconnect if initProse is called. In other words, I think it needs to be moved inside the if statement one line down.

Copy link
Contributor

Choose a reason for hiding this comment

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

@bosschaert, I think you latest merge did mess this up. You never assign the wsProvider and this disconnect should be in the if I think.

Copy link
Member

Choose a reason for hiding this comment

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

@bosschaert I didn't think of the doc change...

This makes me think we need to get a wiki of E2E test steps for our own reminders of what to test for these high impact changes.

  1. Can add table.
  2. Can edit doc.
  3. Can edit doc with another user.
  4. Can switch docs via hashchange

etc.

Ideally this would funnel into Playwright so we don't have to do this stuff manually.

Copy link
Contributor

Choose a reason for hiding this comment

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

@auniverseaway, should be fixed - can you approve again?

Copy link
Contributor Author

@bosschaert bosschaert May 27, 2024

Choose a reason for hiding this comment

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

Thanks for fixing @karlpauls yes it got messed up in the merge.

I created a Playwrighte test wiki here: https://github.com/adobe/da-live/wiki/TODO-%E2%80%90-Playwright-tests

auniverseaway
auniverseaway previously approved these changes May 27, 2024
@bosschaert bosschaert merged commit 658dcc0 into main May 28, 2024
4 of 6 checks passed
@bosschaert bosschaert deleted the parsing-2 branch May 28, 2024 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants