diff --git a/locales/ara.json b/locales/ara.json index be0005cd2f..13babc254d 100644 --- a/locales/ara.json +++ b/locales/ara.json @@ -223,7 +223,7 @@ }, "technicalDifficulty": { "title": "حدث خطأ!", - "message": "شكرًا على صبرك! نحن نواجه صعوبات تقنية في الوقت الحالي. يُرجى المحاولة مرة أخرى لاحقًا أو الاتصال بالمسؤول للحصول على مزيد من المساعدة!" + "message": "شكرا لك على صبركم! نواجه حاليًا صعوبات فنية. يرجى محاولة التنزيل مرة أخرى قريبًا." }, "authorizationGrantTypeNotSupportedByWallet": { "title": "نوع المنحة غير مدعوم خطأ في التفويض!", diff --git a/locales/en.json b/locales/en.json index ee77aee10a..8d5c22f801 100644 --- a/locales/en.json +++ b/locales/en.json @@ -224,7 +224,7 @@ }, "technicalDifficulty": { "title": "An error occurred!", - "message": "Thanks for your patience! We're experiencing technical difficulties right now. Please try again later or contact the admin for further assistance!" + "message": "Thank you for your patience! We're currently experiencing technical difficulties. Please try downloading again shortly." }, "authorizationGrantTypeNotSupportedByWallet": { "title": "Grant type not supported authorization error!", diff --git a/locales/fil.json b/locales/fil.json index ab23b104c8..337ebbb74d 100644 --- a/locales/fil.json +++ b/locales/fil.json @@ -223,7 +223,7 @@ }, "technicalDifficulty": { "title": "May naganap na error!", - "message": "Salamat sa iyong pasensya! Nakakaranas kami ng mga teknikal na paghihirap ngayon. Pakisubukang muli mamaya o makipag-ugnayan sa admin para sa karagdagang tulong!" + "message": "Salamat sa iyong pasensya! Kasalukuyan kaming nakakaranas ng mga teknikal na paghihirap. Pakisubukang mag-download muli sa ilang sandali." }, "authorizationGrantTypeNotSupportedByWallet": { "title": "Ang uri ng grant ay hindi sinusuportahan ng error sa pahintulot!", diff --git a/locales/hin.json b/locales/hin.json index c99248021d..7a088c1934 100644 --- a/locales/hin.json +++ b/locales/hin.json @@ -224,7 +224,7 @@ }, "technicalDifficulty": { "title": "एक त्रुटि पाई गई!", - "message": "आपके धैर्य के लिए धन्यवाद! हम अभी तकनीकी समस्याओं का सामना कर रहे हैं। कृपया बाद में पुनः प्रयास करें या आगे की सहायता के लिए व्यवस्थापक से संपर्क करें!" + "message": "आपके धैर्य के लिए धन्यवाद! हम वर्तमान में तकनीकी कठिनाइयों का सामना कर रहे हैं। कृपया शीघ्र ही पुनः डाउनलोड करने का प्रयास करें।" }, "authorizationGrantTypeNotSupportedByWallet": { "title": "अनुदान प्रकार समर्थित नहीं प्राधिकरण त्रुटि!", diff --git a/locales/kan.json b/locales/kan.json index f466c6e14c..0181975089 100644 --- a/locales/kan.json +++ b/locales/kan.json @@ -223,7 +223,7 @@ }, "technicalDifficulty": { "title": "ದೋಷ ಸಂಭವಿಸಿದೆ!", - "message": "ನಿಮ್ಮ ತಾಳ್ಮೆಗೆ ಧನ್ಯವಾದಗಳು! ನಾವು ಇದೀಗ ತಾಂತ್ರಿಕ ತೊಂದರೆಗಳನ್ನು ಎದುರಿಸುತ್ತಿದ್ದೇವೆ. ದಯವಿಟ್ಟು ನಂತರ ಮತ್ತೆ ಪ್ರಯತ್ನಿಸಿ ಅಥವಾ ಹೆಚ್ಚಿನ ಸಹಾಯಕ್ಕಾಗಿ ನಿರ್ವಾಹಕರನ್ನು ಸಂಪರ್ಕಿಸಿ!" + "message": "ನಿಮ್ಮ ತಾಳ್ಮೆಗೆ ಧನ್ಯವಾದಗಳು! ನಾವು ಪ್ರಸ್ತುತ ತಾಂತ್ರಿಕ ತೊಂದರೆಗಳನ್ನು ಎದುರಿಸುತ್ತಿದ್ದೇವೆ. ದಯವಿಟ್ಟು ಸ್ವಲ್ಪ ಸಮಯದ ನಂತರ ಡೌನ್‌ಲೋಡ್ ಮಾಡಲು ಪ್ರಯತ್ನಿಸಿ." }, "authorizationGrantTypeNotSupportedByWallet": { "title": "ಅನುದಾನದ ಪ್ರಕಾರವನ್ನು ಬೆಂಬಲಿಸುವುದಿಲ್ಲ ದೃಢೀಕರಣ ದೋಷ!", diff --git a/locales/tam.json b/locales/tam.json index 38976bf35c..7905de4422 100644 --- a/locales/tam.json +++ b/locales/tam.json @@ -223,7 +223,7 @@ }, "technicalDifficulty": { "title": "பிழை ஏற்பட்டது!", - "message": "உங்கள் பொறுமைக்கு நன்றி! நாங்கள் தற்போது தொழில்நுட்ப சிக்கல்களை எதிர்கொள்கிறோம். பிறகு முயற்சிக்கவும் அல்லது கூடுதல் உதவிக்கு நிர்வாகியைத் தொடர்பு கொள்ளவும்!" + "message": "உங்கள் பொறுமைக்கு நன்றி! தற்போது தொழில்நுட்ப சிக்கல்களை சந்தித்து வருகிறோம். சிறிது நேரத்தில் மீண்டும் பதிவிறக்க முயற்சிக்கவும்." }, "authorizationGrantTypeNotSupportedByWallet": { "title": "கிராண்ட் வகை ஆதரிக்கப்படவில்லை அங்கீகார பிழை!", diff --git a/machines/Issuers/IssuersActions.ts b/machines/Issuers/IssuersActions.ts index f32346e1db..601223942d 100644 --- a/machines/Issuers/IssuersActions.ts +++ b/machines/Issuers/IssuersActions.ts @@ -6,7 +6,6 @@ import { } from '../../shared/openId4VCI/Utils'; import { MY_VCS_STORE_KEY, - NETWORK_REQUEST_FAILED, REQUEST_TIMEOUT, isIOS, EXPIRED_VC_ERROR_CODE, @@ -27,6 +26,7 @@ import {TelemetryConstants} from '../../shared/telemetry/TelemetryConstants'; import {NativeModules} from 'react-native'; import {KeyTypes} from '../../shared/cryptoutil/KeyTypes'; import {VCActivityLog} from '../../components/ActivityLogEvent'; +import {isNetworkError} from '../../shared/Utils'; const {RNSecureKeystoreModule} = NativeModules; export const IssuersActions = (model: any) => { @@ -83,19 +83,20 @@ export const IssuersActions = (model: any) => { resetSelectedCredentialType: model.assign({ selectedCredentialType: {}, }), - setFetchWellknownError: model.assign({ + setNetworkOrTechnicalError: model.assign({ errorMessage: (_: any, event: any) => { - const error = event.data.message; - if (error.includes(NETWORK_REQUEST_FAILED)) { - return ErrorMessage.NO_INTERNET; - } - return ErrorMessage.TECHNICAL_DIFFICULTIES; + console.error( + `Error occurred during ${event} flow`, + event.data.message, + ); + return isNetworkError(event.data.message) + ? ErrorMessage.NO_INTERNET + : ErrorMessage.TECHNICAL_DIFFICULTIES; }, }), setCredentialTypeListDownloadFailureError: model.assign({ errorMessage: (_: any, event: any) => { - const error = event.data.message; - if (error.includes(NETWORK_REQUEST_FAILED)) { + if (isNetworkError(event.data.message)) { return ErrorMessage.NO_INTERNET; } return ErrorMessage.CREDENTIAL_TYPE_DOWNLOAD_FAILURE; @@ -106,7 +107,7 @@ export const IssuersActions = (model: any) => { errorMessage: (_: any, event: any) => { console.error(`Error occurred while ${event} -> `, event.data.message); const error = event.data.message; - if (error.includes(NETWORK_REQUEST_FAILED)) { + if (isNetworkError(error)) { return ErrorMessage.NO_INTERNET; } if (error.includes(REQUEST_TIMEOUT)) { diff --git a/machines/Issuers/IssuersMachine.ts b/machines/Issuers/IssuersMachine.ts index 8c7a55678e..e46f7ce34d 100644 --- a/machines/Issuers/IssuersMachine.ts +++ b/machines/Issuers/IssuersMachine.ts @@ -101,7 +101,7 @@ export const IssuersMachine = model.createMachine( target: 'downloadCredentialTypes', }, onError: { - actions: ['setFetchWellknownError', 'resetLoadingReason'], + actions: ['setNetworkOrTechnicalError', 'resetLoadingReason'], target: 'error', }, }, @@ -234,16 +234,15 @@ export const IssuersMachine = model.createMachine( { actions: [ 'resetSelectedCredentialType', - 'setError', + 'setNetworkOrTechnicalError', 'resetLoadingReason', - 'sendDownloadingFailedToVcMeta', (_, event) => console.error( 'Error Occurred while invoking Auth - ', event.data, ), ], - target: 'selectingIssuer', + target: 'error', }, ], }, @@ -265,7 +264,7 @@ export const IssuersMachine = model.createMachine( 'sendDownloadingFailedToVcMeta', (_, event) => console.error( - 'Error Occurred while invoking Auth - ', + 'Error Occurred while getting key order - ', event.data, ), ], @@ -294,7 +293,7 @@ export const IssuersMachine = model.createMachine( 'sendDownloadingFailedToVcMeta', (_, event) => console.error( - 'Error Occurred while invoking Auth - ', + 'Error Occurred while getting keypair from keystore - ', event.data, ), ], diff --git a/machines/Issuers/IssuersMachine.typegen.ts b/machines/Issuers/IssuersMachine.typegen.ts index 91ef20ff32..9c77980692 100644 --- a/machines/Issuers/IssuersMachine.typegen.ts +++ b/machines/Issuers/IssuersMachine.typegen.ts @@ -143,12 +143,12 @@ export interface Typegen0 { | 'setCredentialTypeListDownloadFailureError' | 'setCredentialWrapper' | 'setError' - | 'setFetchWellknownError' | 'setIssuers' | 'setLoadingReasonAsDisplayIssuers' | 'setLoadingReasonAsDownloadingCredentials' | 'setLoadingReasonAsSettingUp' | 'setMetadataInCredentialData' + | 'setNetworkOrTechnicalError' | 'setNoInternet' | 'setOIDCConfigError' | 'setPrivateKey' @@ -234,8 +234,7 @@ export interface Typegen0 { sendDownloadingFailedToVcMeta: | 'error.platform.issuersMachine.downloadCredentials:invocation[0]' | 'error.platform.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]' - | 'error.platform.issuersMachine.performAuthorization.setSelectedKey:invocation[0]' - | 'error.platform.issuersMachine.performAuthorization:invocation[0]'; + | 'error.platform.issuersMachine.performAuthorization.setSelectedKey:invocation[0]'; sendErrorEndEvent: 'error.platform.issuersMachine.verifyingCredential:invocation[0]'; sendImpressionEvent: 'done.invoke.issuersMachine.displayIssuers:invocation[0]'; sendSuccessEndEvent: 'done.invoke.issuersMachine.verifyingCredential:invocation[0]'; @@ -246,9 +245,7 @@ export interface Typegen0 { | 'error.platform.issuersMachine.downloadCredentials:invocation[0]' | 'error.platform.issuersMachine.fetchAuthorizationEndpoint:invocation[0]' | 'error.platform.issuersMachine.performAuthorization.getKeyPairFromKeystore:invocation[0]' - | 'error.platform.issuersMachine.performAuthorization.setSelectedKey:invocation[0]' - | 'error.platform.issuersMachine.performAuthorization:invocation[0]'; - setFetchWellknownError: 'error.platform.issuersMachine.downloadIssuerWellknown:invocation[0]'; + | 'error.platform.issuersMachine.performAuthorization.setSelectedKey:invocation[0]'; setIssuers: 'done.invoke.issuersMachine.displayIssuers:invocation[0]'; setLoadingReasonAsDisplayIssuers: 'TRY_AGAIN'; setLoadingReasonAsDownloadingCredentials: @@ -264,6 +261,9 @@ export interface Typegen0 { setMetadataInCredentialData: | 'done.invoke.issuersMachine.verifyingCredential:invocation[0]' | 'error.platform.issuersMachine.verifyingCredential:invocation[0]'; + setNetworkOrTechnicalError: + | 'error.platform.issuersMachine.downloadIssuerWellknown:invocation[0]' + | 'error.platform.issuersMachine.performAuthorization:invocation[0]'; setNoInternet: 'done.invoke.checkInternet'; setOIDCConfigError: 'error.platform.issuersMachine.performAuthorization:invocation[0]'; setPrivateKey: 'done.invoke.issuersMachine.generateKeyPair:invocation[0]'; diff --git a/screens/Issuers/IssuerScreenController.tsx b/screens/Issuers/IssuerScreenController.tsx index 585bccf625..4f582ec565 100644 --- a/screens/Issuers/IssuerScreenController.tsx +++ b/screens/Issuers/IssuerScreenController.tsx @@ -52,6 +52,7 @@ export function useIssuerScreenController({route, navigation}) { service, selectVerificationErrorMessage, ), + isError: useSelector(service, selectIsError), CANCEL: () => service.send(IssuerScreenTabEvents.CANCEL()), SELECTED_ISSUER: id => diff --git a/screens/Issuers/IssuersScreen.tsx b/screens/Issuers/IssuersScreen.tsx index 46220b6b66..8118c22b13 100644 --- a/screens/Issuers/IssuersScreen.tsx +++ b/screens/Issuers/IssuersScreen.tsx @@ -41,6 +41,7 @@ export const IssuersScreen: React.FC< const [search, setSearch] = useState(''); const [tapToSearch, setTapToSearch] = useState(false); const [clearSearchIcon, setClearSearchIcon] = useState(false); + const showFullScreenError = controller.isError && controller.errorMessageType; const isVerificationFailed = controller.verificationErrorMessage !== ''; @@ -51,7 +52,7 @@ export const IssuersScreen: React.FC< : t(`errors.verificationFailed.ERR_GENERIC`); useLayoutEffect(() => { - if (controller.loadingReason || controller.errorMessageType) { + if (controller.loadingReason || showFullScreenError) { props.navigation.setOptions({ headerShown: false, }); @@ -202,7 +203,7 @@ export const IssuersScreen: React.FC< ); } - if (controller.errorMessageType) { + if (showFullScreenError) { return ( { } return result; }; + +export const isNetworkError = (error: string) => { + return error.includes(NETWORK_REQUEST_FAILED); +}; \ No newline at end of file