Skip to content

Comments

Do not crash when storage proposal is not ready#418

Merged
dgdavid merged 3 commits intomasterfrom
fix-storage-client
Feb 9, 2023
Merged

Do not crash when storage proposal is not ready#418
dgdavid merged 3 commits intomasterfrom
fix-storage-client

Conversation

@dgdavid
Copy link
Contributor

@dgdavid dgdavid commented Feb 8, 2023

Problem

After commit f0db9e4, the UI crashes "silently" the first time a product is selected after running the service. Hard to explain why (maybe @imobachgs or @joseivanlopez can edit this description for adding more info)

Solution

To protect the code by using the optional chaining (?) operator AND intercepting the broken promise for returning undefined. I.e., adapting the code for returning an empty object when the proposal does not exist yet or is not .valid.

Testing

  • Added a new unit test
  • Tested manually

Screenshots

Look at the content of the Storage section after selecting the product for first time, not only to the errors in the console.

Before After
Screenshot from 2023-02-08 16-16-15 Screenshot from 2023-02-08 17-27-41

The console output in the after screenshot has no relation with this issue. It comes from Software section and will be dropped soon.

dgdavid

This comment was marked as outdated.

@dgdavid dgdavid force-pushed the fix-storage-client branch from 3fbd7b3 to 90e7ea1 Compare February 8, 2023 18:29
@coveralls
Copy link

coveralls commented Feb 8, 2023

Coverage Status

Coverage: 77.943% (+0.03%) from 77.916% when pulling c41bdd6 on fix-storage-client into 4b7d439 on master.

@dgdavid dgdavid changed the title Do not crash when there is no storage proposal yet Do not crash when storage proposal is not ready Feb 8, 2023
@dgdavid dgdavid force-pushed the fix-storage-client branch from 5a7a1aa to bdfec4c Compare February 9, 2023 14:16
@dgdavid dgdavid force-pushed the fix-storage-client branch from bdfec4c to c41bdd6 Compare February 9, 2023 14:19
@dgdavid dgdavid requested a review from imobachgs February 9, 2023 14:20
Copy link
Contributor

@imobachgs imobachgs left a comment

Choose a reason for hiding this comment

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

Much better now 😄

@dgdavid dgdavid merged commit f9fa0d2 into master Feb 9, 2023
@dgdavid dgdavid deleted the fix-storage-client branch February 9, 2023 14:43
@imobachgs imobachgs mentioned this pull request Feb 13, 2023
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Feb 16, 2023
https://build.opensuse.org/request/show/1066106
by user IGonzalezSosa + dimstar_suse
- Version 0.7
- Do not use a proxy to get the errors lists
  (gh#agama-project/agama#424).

- Add live reloading feature for easing the front-end development
  process (gh#agama-project/agama#419).

- Fix storage section crashing when proposal is not ready
  (gh#agama-project/agama#418).

- Better handling of software repositories
  (gh#agama-project/agama#414):
  * Report issues when reading the software repositories.
  * Inform the user about the software proposal progress.
  * Add a button to reload the repositories
    (gh#agama-project/agama#388).

- Added a button for displaying the YaST logs
  (related to gh#agama-project/agama#379)

- UI fixes (gh#agama-project/agama#401):
  * Add a fallback height for the layout
  * Fix some miss-alignments
  * Add missing icon
  * Ensure tooling serving and loading fo
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