instructure / canvas-lms

The open LMS by Instructure, Inc.
https://github.com/instructure/canvas-lms/wiki
GNU Affero General Public License v3.0
5.57k stars 2.47k forks source link

jquery `Uncaught Error: Syntax error, unrecognized expression: [value=]` when adding attachment to message #2343

Closed breiter closed 5 months ago

breiter commented 5 months ago

Summary:

Attachment feature on messages is broken and silently fails with console js errors from inside of jquery logged.

Uncaught Error: Syntax error, unrecognized expression: [value=]

Steps to reproduce:

  1. build a release branch from release/2024-04-10.207
  2. log in and navigate to inbox
  3. compose a new message and click the attach button, select a file and upload.
  4. nothing appears to happen in the ui but in the javascript console there is an error logged:

main-entry-5e45442811faaf3e.js:4034 Uncaught Error: Syntax error, unrecognized expression: [value=]

Expected behavior:

Document should attach to the message

Actual behavior:

javascript error.

Screenshot 2024-04-18 at 10 58 01 Screenshot 2024-04-18 at 10 58 34

Additional notes:

This code has not changed in a long time.

https://github.com/instructure/canvas-lms/blob/f5b65f521d7687821582591e9415dec74dc292ab/ui/features/conversations/backbone/views/MessageFormDialog.js#L651-L656

I suspect this problem may be related to a change in jquery:

commit 7b8e932592936232055f541750b514cbc906ea0c

upgrade to jquery 3.5

with jquery-migrate 3.4.1 (added to instructure_jquery_patches.js this time, as it wasn't being loaded soon enough for header usage in runOnEveryPageButDontBlockAnythingElse.jsx)

this change also disables the assignment column resizing and reordering feature in the grid gradebook. The drag library used for this feature does not support jquery 3.x and it is a blocker

refs FOO-4260 flag=none

Test Plan:

[skip-crystalball] [fsc-max-nodes=18] [fsc-timeout=40]

Change-Id: I56ff289813c532c98279766dbca19b9ec28c5d0c Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/341600 Product-Review: Ryan Norton rnorton@instructure.com QA-Review: August Thornton august@instructure.com Tested-by: Service Cloud Jenkins svc.cloudjenkins@instructure.com Reviewed-by: Michael Hulse michael.hulse@instructure.com

breiter commented 4 months ago

Applying c638a66949f34ba7d438964687047985a20d5ada to release/2024-04-10.x does resolve the issue of attachments however there is a problem where the message popover does not close after sending a message.