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

Uncaught TypeError: Cannot read properties of undefined (reading 'formattedName') [Google Chrome only] #1894

Open
GustavoSatig opened this issue Jan 17, 2025 · 0 comments

Comments

@GustavoSatig
Copy link

Describe the bug
Intermittent error when trying to compose an email from the Contacts screen.

Sometimes, when selecting a contact and clicking the option to send an email, the email composition window does not open. Instead, it returns to the Email screen, and an error appears in the console.

To Reproduce
Steps to reproduce the behavior:

  1. Open the Contacts screen.
  2. Select a contact.
  3. Press F12 and click the option to send an email.
  4. Occasionally, the email composition window fails to open, and an error is logged in the console.

Expected behavior
The email composition window should open immediately when clicking the option to send an email.

Screenshots
N/A

Please complete the following information:

  • Browser: Chrome 132.0.6834.83
  • IMAP daemon: Dovecot
  • PHP version: 8.3
  • SnappyMail Version: 2.38.2
  • Mode: Integrated with Nextcloud

Debug/logging information

Uncaught TypeError: Cannot read properties of undefined (reading 'formattedName')
    at new ComposePopupView (app.min.js?v=4.18.2:1:142079)
    at Ms (app.min.js?v=4.18.2:1:49669)
    at Ns (app.min.js?v=4.18.2:1:51468)
    at AppUser.showMessageComposer (app.min.js?v=4.18.2:1:213383)
    at Er (app.min.js?v=4.18.2:1:109306)
    at wr (app.min.js?v=4.18.2:1:109169)

    ComposePopupView	@	app.min.js?v=4.18.2:1
    Ms	@	app.min.js?v=4.18.2:1
    Ns	@	app.min.js?v=4.18.2:1
    showMessageComposer	@	app.min.js?v=4.18.2:1
    Er	@	app.min.js?v=4.18.2:1
    wr	@	app.min.js?v=4.18.2:1
    (anonymous)	@	app.min.js?v=4.18.2:1
    setTimeout		
    (anonymous)	@	app.min.js?v=4.18.2:1
    (anonymous)	@	app.min.js?v=4.18.2:1
    Promise.then		
    ir	@	app.min.js?v=4.18.2:1
    start	@	app.min.js?v=4.18.2:1
    bootstart	@	app.min.js?v=4.18.2:1
    bootstart	@	app.min.js?v=4.18.2:1
    n	@	snappymail/:367
    (anonymous)	@	snappymail/:367
    Promise.then		
    (anonymous)	@	snappymail/:367
    Promise.then		
    (anonymous)	@	snappymail/:367
    (anonymous)	@	snappymail/:367

Additional context
After analyzing the issue, it seems that the loadAccountsAndIdentities function is not asynchronous, causing the code flow to continue before the store is properly updated with the identities. This issue occurs intermittently. I tried alternatives using Promises but was not successful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant