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

Hyperlink preview glitch #9013

Open
pedropintosilva opened this issue May 9, 2024 · 1 comment
Open

Hyperlink preview glitch #9013

pedropintosilva opened this issue May 9, 2024 · 1 comment
Labels
23.05 24.04 bug Something isn't working

Comments

@pedropintosilva
Copy link
Contributor

pedropintosilva commented May 9, 2024

Describe the Bug

Hyperlink preview glitch (keeps flickering). We keep receiving the same postmessage over and over.

Steps to Reproduce

  1. Multiple users: Open a text office file with hyperlinks using Nextcloud
  2. One user moves the text cursor above one of the hyperlinks
  3. Preview appears but keeps flashing
  4. See the errors in the web console log

Logs

May 09 2024

I was able to reproduce this again, I think:

Peek.2024-05-09.16-03.mp4

One user is sitting - without moving the text cursor - on a hyperlink while the other user edits text. In this test both used FF. But I think @mmeeks tried the same test and we couldn't reproduce it so maybe there is one more step I'm missing here.

console-export-2024-5-9_16-3-45.txt

Oct 2023

For example multiple previews coming from the same exact url https://github.com/CollaboraOnline/online/issues/7256:

See the logs from Oct 2023:
console-export-2023-10-12_12-6-46.txt

Expected Behavior

We probably shouldn't be fetching the same preview multiple times

Actual Behavior

It seems we are fetching the preview multiple times

Screenshots

If applicable, add screenshots to help explain your problem.

Desktop

Firstly reported on Oct 12 2023 https://forum.collaboraonline.com/t/community-weekly-meeting-140/2129#online-activity-4

COOLWSD version: 23.05.5.1 (git hash: dffef0e (E))
LOKit version: Collabora Office 23.05.5.1 (git hash: 9f03693)
Served by: openSUSE Leap 15.5
Server ID: 3a813eff

Latest observed on May 09 2024

Today in the Community Meeting the hash was on https://github.com/CollaboraOnline/online/commits/f4265ce8

@mmeeks
Copy link
Contributor

mmeeks commented May 9, 2024

Past of my analysis:

  • Stack trace:

    TLDR; cause is getting "invalidatecursor:" messages left & right
    + these can be caused by other user's actions moving
    the view.

    • weirdly we are getting 'invalidatecursor' for different view-ids.

    • also duplicate 'editor: ' messages back to back (!?)

PostMessageService.sendPostMessage (postMessage.tsx:52)

(anonymous) (document.js:404)

      // Pass all messages to viewer if not direct editing or
      if (!isDirectEditing() && ViewerToLool.indexOf(msgId) === -1) {
        PostMessages.sendPostMessage('parent', data);
      }

(anonymous) (postMessage.tsx:107)

  try {
    fn({
      data: data,
      parsed: parsed
    });
  } catch (e) {
    console.error('Error during post message handler', parsed, e);
  }

PostMessageService.handlePostMessage (postMessage.tsx:101)

this.postMessageHandlers.forEach(function (fn) {

-> only one postMessageHandler

(anonymous) (postMessage.tsx:38)

window.addEventListener('message', function (event) {
  _this.handlePostMessage(event.data);
}, false);

postMessage (async)

            var msg = {
                MessageId: msgId,
                SendTime: Date.now(),
                Values: values
            };
            window.parent.postMessage(JSON.stringify(msg), this.PostMessageOrigin)

_postMessage (bundle.js:21766)

            for (id in typeIndex) {
                typeIndex[id].fn.call(typeIndex[id].ctx, event)
            }

fire (bundle.js:9863)

_showURLPopUp (bundle.js:16303)

        if (this._map["wopi"].EnableRemoteLinkPicker)
            this._map.fire("postMessage", {
                msgId: "Action_GetLinkPreview",
                args: {
                    url: url
                }
            })

_onInvalidateCursorMsg (bundle.js:16324)

        this._map.lastActionByUser = false;
        this._map.hyperlinkUnderCursor = obj.hyperlink;
        this._closeURLPopUp();
        if (obj.hyperlink && obj.hyperlink.link) {
            this._showURLPopUp(this._map._docLayer._twipsToLatLng({
                x: app.file.textCursor.rectangle.x1,
                y: app.file.textCursor.rectangle.y1
            }), obj.hyperlink.link)
        }

_onMessage (bundle.js:15961)

        } else if (textMsg.startsWith("invalidatecursor:")) {
            this._onInvalidateCursorMsg(textMsg)

_onMessage (bundle.js:10216)

        if (!this._map._docLayer || this._handlingDelayedMessages) {
            this._delayMessage(textMsg)
        } else {
            this._map._docLayer._onMessage(textMsg, e.image)
        }

_emitSlurpedEvents (bundle.js:9970)
(anonymous) (bundle.js:9957)
setTimeout (async)
_queueSlurpEventEmission (bundle.js:9957)
_slurpMessage (bundle.js:9977)

Log is
online-url-popup.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
23.05 24.04 bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

2 participants