Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#33954 closed defect (bug) (fixed)

Remove unused instances of wpview

Reported by: azaozz Owned by: iseulde
Priority: normal Milestone: 4.4
Component: TinyMCE Version: 4.2
Severity: normal Keywords: has-patch fixed-major
Cc: Focuses:

Description

There may be unused instances of wpviews in some cases. For example when we check an URL on its own line, we add "markers" and create an instance. Then we do AJAX request to try to embed it. If it is not embeddable, we remove the markers but the instance remains.

Attachments (2)

33954.patch (908 bytes ) - added by azaozz 11 years ago.
33954.2.patch (776 bytes ) - added by iseulde 11 years ago.

Download all attachments as: .zip

Change History (11)

@azaozz
11 years ago

#1 @iseulde
11 years ago

This is partly intentional and designed like this since the beginning. When a view is removed, the instance remains so it can be reused if it's created again (meaning no server request). Of course, if it is not embeddable, maybe there's not much point in caching it, though it would be useful if the user tries to embed again (so caching both successes and errors).

#2 @wonderboymusic
11 years ago

  • Owner set to iseulde
  • Status newassigned

#3 @iseulde
11 years ago

  • Keywords needs-patch added
  • Version 4.34.2

When an instance is reused for a non embeddable URL, the marker is not removed after using the cached response (so it is the first time, not any time after). This needs a fix.
We need to keep responses however, even failures, as there would be new server requests every time the DOM refreshes or when switching between text and visual. The DOM refreshes are the most important though, it triggers for example every time you undo or redo something.

#4 @iseulde
11 years ago

  • Status assignedaccepted

@iseulde
11 years ago

#5 follow-up: @iseulde
11 years ago

  • Keywords has-patch added; needs-patch removed

33954.2.patch: Keep the instance but mark it to be ignored when parsing the content to avoid more requests.

This ticket was mentioned in Slack in #core-editor by iseulde. View the logs.


11 years ago

#7 in reply to: ↑ 5 @azaozz
11 years ago

Replying to iseulde:

Yep, that works better :)

#8 @iseulde
11 years ago

  • Resolutionfixed
  • Status acceptedclosed

In 35216:

TinyMCE: make sure markers are removed after first init

This is only relevant to non embeddable URLs.
After first init, markers were set but not removed,
causing an edited URL to revert when switching to text mode
or any paragraph after the URL to just contain that URL.

Fixes #33954.

#9 @iseulde
11 years ago

  • Keywords fixed-major added

Reopening for previous releases.

Note: See TracTickets for help on using tickets.