Error message won't close when hitting "dismiss" button

RESOLVED FIXED

Status

RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Jacob, Assigned: pomax)

Tracking

Details

(Whiteboard: mozfest)

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
Thought we fixed this, but here it is

https://thimble.webmaker.org/project/15678/remix

Tried to hit "dismiss" to close the error message, but nothing happened
Confirmed.  you can see this here, too.

https://thimble.webmaker.org/project/15677/remix
Assignee: nobody → pomax
Whiteboard: mozfest
(Assignee)

Comment 2

5 years ago
This looks like it only happens when you open a page that already has an error on it. The web console reports:

Uncaught TypeError: Cannot call method 'getBoundingClientRect' of undefined gutter-pointer.js:48
gutterPointer gutter-pointer.js:48
Relocator.relocator.relocate relocator.js:71
reportError error-help.js:70
(anonymous function) error-help.js:87
GET https://thimble.webmaker.org/resources/fonts/opensans-bolditalic-webfont.woff 404 (Not Found) 

so it looks like the error message tries to attach itself to CodeMirror, before CodeMirror is done setting up all its on-page components.
Status: NEW → ASSIGNED
(Assignee)

Comment 3

5 years ago
Created attachment 812321 [details] [review]
https://github.com/mozilla/thimble.webmaker.org/pull/241

best bug in recent history. Errors are tied to the codemirror cursor for placement, but when you load a project with bad code, there is no cursor position yet, and all placement bets are off. This patch checks to see if there is an error after slowparsing, and if so, whether there is a cursor position. If there is no cursor position, it actually tells codeMirror what the cursor's position should be before handing off the error handling to the rest of the code. This does two things:

1. the error dialog is now in the right place, and dismissable
2. the code editor will immediately "scoll" to the offending section of the page so you don't have to go looking for where the error is. It'll be immediately obvious.

STR: run locally, copy code from https://thimble.webmaker.org/project/15677/remix and publish locally. Loading up the /edit link in a new tab will show the error dialog majestically in the way. Check out patch, rerun thimble, open page; the dialog should now be in the right place, and the code scrolled all the way to the bottom with line 421 the operative error anchor.
Attachment #812321 - Flags: review?(scott)
Attachment #812321 - Flags: review?(scott) → review+

Comment 5

5 years ago
Commit pushed to master at https://github.com/mozilla/thimble.webmaker.org

https://github.com/mozilla/thimble.webmaker.org/commit/56a8f6cfc5768b2cdff99d50cff09fee47bcb13c
Merge pull request #241 from Pomax/bug919636

tell codemirror where an error is, if the cursor is at 0/0
(Assignee)

Comment 6

5 years ago
landed.
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Attachment mime type: text/plain → text/x-github-pull-request
You need to log in before you can comment on or make changes to this bug.