feat: display global notification on API request failures (fixes #2106)#2340
Conversation
23ab6a7 to
b1f6c3b
Compare
|
Ey @keshav0479 this looks great! Can you please also take into consideration |
|
Thanks for the review @KoalaSat! I completely missed the Android client. I have just pushed a commit that applies the same error broadcasting logic to frontend/src/services/api/ApiAndroidClient/index.ts. I also took the opportunity to refactor the Android client to use a centralized request helper (similar to the Web client) to reduce code duplication. |
|
@keshav0479 awesome thank you! can you please also remove comments? we usually try to avoid them unless for extremely complex code |
|
Done! I've removed the comments to keep the code clean |
KoalaSat
left a comment
There was a problem hiding this comment.
Great job @keshav0479 !
Please accept a small tip for your work. Share here a LN invoice with a long expiration date for 90,000 sats
|
Thank you @KoalaSat! I really appreciate the review and the tip. lnbc900u1p54e77qpp5la9n2wkzh32w74z2qum63rynv6cx9p09240qjvljhp9y56fg4ftscqzyssp5r2xkjeetwd7zl37rrhq54kw9pmu5q49gztm06vxezg975x4at4wq9q7sqqqqqqqqqqqqqqqqqqqsqqqqqysgqdqqmqz9gxqyjw5qrzjqwryaup9lh50kkranzgcdnn2fgvx390wgj5jd07rwr3vxeje0glcll63a0scqz7stsqqqqlgqqqqqeqqjqsr7gqckx3k4uc20zrdqkwyg27umme6q02crlsmrkm9vthm6wqhs8ahush8kj3kgjepshqlsas20r6we6tmyfvn4uv9f9f7qr759v7msq070456 |
|
dd591ec4b11d7cfc3f3433c1299d2153facc64936c2eb92e7062debf3591fd2a |

Description
Fixes #2106
This PR introduces a global error handling mechanism in
ApiWebClient. Previously, network timeouts or coordinator unreachable errors resulted in silent failures. Now, these failures dispatch aROBOSATS_API_ERRORcustom event.The main
Appcomponent has been updated to listen for this event and display a user-friendlySnackbaralert at the bottom of the interface.Changes
ApiWebClient.tsto use a centralrequesthelper with error catching.SnackbaranduseEffectlistener inApp.tsxto handle the error broadcasts.pre-commit(Prettier and ESLint passed).Testing