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

isDeepEqual crashes while comparing Sets #15248

Closed
alberto-i opened this issue Jan 10, 2023 · 1 comment
Closed

isDeepEqual crashes while comparing Sets #15248

alberto-i opened this issue Jan 10, 2023 · 1 comment
Assignees
Labels
area/components bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite kind/bug 🐞 Qv2 🔝 Quasar v2 issues

Comments

@alberto-i
Copy link

alberto-i commented Jan 10, 2023

What happened?

This problem started after adding a "Set" attribute to an object used in a q-select with remote filter for refresh. After the first selection, an exception will be thrown the next time the select is open.

This happens in isDeepEqual method that does not support Set correctly (it's trying to call a non existing "next" from a single entry instead of the original entries).

What did you expect to happen?

The select should open normally.

Reproduction URL

https://codepen.io/alberto-i/pen/WNKpyvB

How to reproduce?

  1. Go to the reproduction link
  2. Select something in the available select box
  3. Try to select another option
  4. Check the exception in the console

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

Components (quasar)

Platforms/Browsers

Firefox, Chrome, Safari, Microsoft Edge, iOS, Android, Electron, Other

Quasar info output

Operating System - Windows_NT(10.0.22621) - win32/x64
NodeJs - 18.12.1

Global packages
  NPM - 8.19.2
  yarn - 1.22.19
  @quasar/cli - 1.3.2
  @quasar/icongenie - 2.5.3
  cordova - Not installed

Important local packages
  quasar - 2.10.2 -- Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time
  @quasar/app-vite - 1.1.3 -- Quasar Framework App CLI with Vite
  @quasar/extras - 1.15.8 -- Quasar Framework fonts, icons and animations
  eslint-plugin-quasar - Not installed
  vue - 3.2.45 -- The progressive JavaScript framework for building modern web UI.
  vue-router - 4.1.6
  pinia - 2.0.28 -- Intuitive, type safe and flexible Store for Vue
  vuex - Not installed
  vite - 4.0.1 -- Native-ESM powered web dev build tool
  eslint - 8.29.0 -- An AST-based pattern checker for JavaScript.
  electron - 21.3.3 -- Build cross platform desktop apps with JavaScript, HTML, and CSS
  electron-packager - 15.5.2 -- Customize and package your Electron app with OS-specific bundles (.app, .exe, etc.) via JS or CLI
  electron-builder - Not installed
  register-service-worker - 1.7.2 -- Script for registering service worker, with hooks
  @capacitor/core - Not installed
  @capacitor/cli - Not installed
  @capacitor/android - Not installed
  @capacitor/ios - Not installed

Quasar App Extensions
  *None installed*

Networking
  Host - Qi-Alberto
  Local Area Connection - 172.21.22.34
  Wi-Fi - 192.168.1.29

Relevant log output

quasar.esm.js:1470 Uncaught (in promise) TypeError: i.next is not a function
    at isDeepEqual (quasar.esm.js:1470:15)
    at isDeepEqual (quasar.esm.js:1513:11)
    at quasar.esm.js:28153:54
    at Array.findIndex (<anonymous>)
    at updateMenu (quasar.esm.js:28153:39)
    at callWithErrorHandling (runtime-core.esm-bundler.js:157:22)
    at callWithAsyncErrorHandling (runtime-core.esm-bundler.js:166:21)
    at job (runtime-core.esm-bundler.js:1794:17)
    at callWithErrorHandling (runtime-core.esm-bundler.js:157:36)
    at flushJobs (runtime-core.esm-bundler.js:390:17)

Additional context

This is the relevant code that throws the exception:
From /ui/src/utils/is.js


if (a.constructor === Set) {
  if (a.size !== b.size) {
    return false
  }

  i = a.entries().next()
  while (i.done !== true) {
    if (b.has(i.value[ 0 ]) !== true) {
      return false
    }
    i = i.next() // THIS LINE WILL THROW THE EXCEPTION
  }

  return true
}

@alberto-i alberto-i added kind/bug 🐞 Qv2 🔝 Quasar v2 issues labels Jan 10, 2023
@github-actions github-actions bot added area/components bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite labels Jan 10, 2023
@alberto-i alberto-i changed the title isDeepEquals crashed while comparing Sets isDeepEqual crashes while comparing Sets Jan 10, 2023
@rstoenescu rstoenescu self-assigned this Jan 10, 2023
@rstoenescu
Copy link
Member

Hi,

Thanks for reporting!
Fix will be enabled in Quasar v2.11.5 and v1.22.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/components bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite kind/bug 🐞 Qv2 🔝 Quasar v2 issues
Projects
None yet
Development

No branches or pull requests

2 participants