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

[TASK-1117] Fix alertify elusive crash when (un)archiving a project from My Projects #5151

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

magicznyleszek
Copy link
Member

Checklist

  1. If you've added code that should be tested, add tests
  2. If you've changed APIs, update (or create!) the documentation
  3. Ensure the tests pass
  4. Run ./python-format.sh to make sure that your code lints and that you've followed our coding style
  5. Write a title and, if necessary, a description of your work suitable for publishing in our release notes
  6. Mention any related issues in this repository (as #ISSUE) and in other repositories (as kobotoolbox/other#ISSUE)
  7. Open an issue in the docs if there are UI/UX changes

Notes

I was able to reproduce the bug sometimes. I no longer can reproduce it now, so I am not sure this PR fixes it. It's an educated guess.

This particular alertify instance has an async function insid onok callback, and only then is closing the dialog. But the onok is closing the dialog by default - unless the callback returns false. My guess is that without return false; alertify was trying to close the dialog and cleanup some inner things. And then the callback was resolved and it also tried to close the dialog. And sometimes this works fine, and sometimes it doesn't - this is my theory 😉

Copy link

@magicznyleszek magicznyleszek marked this pull request as ready for review October 4, 2024 12:30
// sometimes when `actions.resources.setDeploymentActive` finishes,
// the `dialog.destroy` can't find something and crashes with:
// `Uncaught TypeError: instance.__internal is undefined`
return false;
Copy link
Contributor

@p2edwards p2edwards Oct 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested and it works! Just needs to be in the unarchiveAsset function too 👍

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

Successfully merging this pull request may close these issues.

3 participants