-
-
Notifications
You must be signed in to change notification settings - Fork 45
Handled failed job claim #3302
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
Handled failed job claim #3302
Changes from all commits
6bedb37
73756f5
0689244
a919170
4646929
d8473b7
2e5ae17
582f677
8c61c95
061d071
52644a0
15d32e6
f3ecc3f
ddb2aab
b65d1cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,12 @@ | ||
| package org.commcare.fragments.connect; | ||
|
|
||
| import static org.commcare.utils.ViewUtils.showSnackBarWithDismissAction; | ||
|
|
||
| import android.os.Bundle; | ||
| import android.view.LayoutInflater; | ||
| import android.view.View; | ||
| import android.view.ViewGroup; | ||
| import android.widget.Button; | ||
| import android.widget.Toast; | ||
|
|
||
| import androidx.annotation.NonNull; | ||
| import androidx.annotation.Nullable; | ||
|
|
@@ -17,17 +18,13 @@ | |
| import org.commcare.android.database.connect.models.ConnectJobRecord; | ||
| import org.commcare.android.database.connect.models.ConnectPaymentUnitRecord; | ||
| import org.commcare.android.database.connect.models.ConnectUserRecord; | ||
| import org.commcare.android.database.global.models.ApplicationRecord; | ||
| import org.commcare.connect.database.ConnectJobUtils; | ||
| import org.commcare.connect.database.ConnectUserDatabaseUtil; | ||
| import org.commcare.connect.network.connect.ConnectApiHandler; | ||
| import org.commcare.connect.network.connectId.PersonalIdApiErrorHandler; | ||
| import org.commcare.dalvik.R; | ||
| import org.commcare.dalvik.databinding.FragmentConnectDeliveryDetailsBinding; | ||
| import org.commcare.google.services.analytics.FirebaseAnalyticsUtil; | ||
| import org.commcare.utils.MultipleAppsUtil; | ||
|
|
||
| import java.io.InputStream; | ||
|
|
||
| public class ConnectDeliveryDetailsFragment extends ConnectJobFragment { | ||
|
|
||
|
|
@@ -108,7 +105,13 @@ public void onSuccess(Boolean data) { | |
|
|
||
| @Override | ||
| public void onFailure(@NonNull PersonalIdOrConnectApiErrorCodes errorCode, @Nullable Throwable t) { | ||
| Toast.makeText(requireContext(), PersonalIdApiErrorHandler.handle(requireActivity(), errorCode, t), Toast.LENGTH_LONG).show(); | ||
| String message; | ||
| if (errorCode == PersonalIdOrConnectApiErrorCodes.BAD_REQUEST_ERROR) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: We could use the if only to choose the string into a variable, then have a single line calling showSnackBarWithDismissAction (to reduce duplicated code).
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @OrangeAndGreen updated it |
||
| message = getString(R.string.recovery_unable_to_claim_opportunity); | ||
| } else { | ||
| message = PersonalIdApiErrorHandler.handle(requireActivity(), errorCode, t); | ||
| } | ||
| showSnackBarWithDismissAction(binding.getRoot(), message); | ||
| FirebaseAnalyticsUtil.reportCccApiClaimJob(false); | ||
| } | ||
| }.claimJob(requireContext(), user, job.getJobId()); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify string usage and translation coverage
Ensure all targeted locales include this key and that the code references the resource (not a hardcoded string).
🏁 Script executed:
Length of output: 6212
🏁 Script executed:
Length of output: 299
🏁 Script executed:
Length of output: 4868
Missing translations in Lithuanian and Norwegian
All code references use the resource (no hard-coded strings), and the key is present in the default and most locale folders. However, the following locale-specific
strings.xmlfiles are missing therecovery_unable_to_claim_opportunityentry:Please add the localized string for these languages (or confirm they aren’t targeted).
🤖 Prompt for AI Agents