#33954 closed defect (bug) (fixed)
Remove unused instances of wpview
Reported by: | azaozz | Owned by: | iseulde |
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | 4.2 |
Component: | TinyMCE | Keywords: | has-patch fixed-major |
Focuses: | Cc: |
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)
Change History (11)
#3
@
9 years ago
- Keywords needs-patch added
- Version changed from 4.3 to 4.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.
#5
follow-up:
↓ 7
@
9 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 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).