Skip to content

OBLS-936 Fix duplicate product scan in sorted putaway on DataWedge scans - #444

Merged
awalkowiak merged 2 commits into
developfrom
OBLS-936
Sep 3, 2026
Merged

OBLS-936 Fix duplicate product scan in sorted putaway on DataWedge scans#444
awalkowiak merged 2 commits into
developfrom
OBLS-936

Conversation

@olewandowski1

@olewandowski1 olewandowski1 commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

https://openboxes.atlassian.net/browse/OBLS-936

Changes:

  • Track the scan-vs-manual flag in a ref so a DataWedge scan on the user-directed putaway list is not read as manual entry

Before:
https://github.com/user-attachments/assets/fb5bc4ba-f522-434a-a929-842e4344d299

After:
https://github.com/user-attachments/assets/17706681-43e2-41a0-a58c-9f3aa4bbe985

The user-directed putaway list decided whether a validation scan was required
from React state written in ScannerInput's onChange handler. A DataWedge scan
arrives as an intent broadcast, which calls onChange and onSubmit back to back
in the same tick, so the submit handler still read the previous value and
treated the scan as a manual entry. The product then had to be scanned again
after the destination.

Keep the flag in a ref so it updates synchronously and both input paths agree.
Only the intent path is affected, so this reproduces on Zebra devices running
the DataWedge profile (confirmed on TC52 and TC53) but not on the emulator, on
keystroke wedge scanners, or when the code is typed by hand, where the submit
lands in a later tick.

@awalkowiak awalkowiak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@jmiranda Do you have an option to test it from the experimental build?

@jmiranda

Copy link
Copy Markdown
Member

@awalkowiak yes, i can use the experimental build or build the branch locally.

…nner

DataWedge rejected every profile config the app sent, logging
"Key PROFILE_ENABLED expected String but value was a java.lang.Boolean"
and the same for RESET_CONFIG, so the OPENBOXES profile was never
enabled and the integrated scanner did not deliver scans to the app.

react-native-datawedge-intents builds the config bundle by calling
String.valueOf() on the object it is given and re-parsing the result as
JSON. A nested object arrives at the native side as a Java Map, whose
toString() ("{PROFILE_ENABLED=true, ...}") re-parses with unquoted values
as booleans and numbers - DataWedge requires Strings there and drops
them. Serialising the config with JSON.stringify keeps every value a
String; the bridge parses the JSON into the same nested bundle.

Also associate the profile with the package the app is actually running
under (DeviceInfo.getBundleId()) instead of a hardcoded
com.openboxes.android, so branded and experimental builds whose
applicationId carries a suffix activate the profile too.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HePztn8cebd1ecp7pmZrPv
@jmiranda

jmiranda commented Sep 1, 2026

Copy link
Copy Markdown
Member

@olewandowski1 @awalkowiak Not sure if you saw this but I (Claude) added a potential fix to this last week. I tested this on the Zebra TC20 and TC52. We probably need to test in the emulator as well as with an external barcode scanner to see how it behaves.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Fixes an issue in the sorted putaway task list where DataWedge hardware scans could be misclassified as manual entry due to onChange/onSubmit occurring in the same tick, leading to duplicate/incorrect scan handling.

Changes:

  • Track “scan vs manual” using a ref in PutawayTaskListScreen so onSubmit sees the updated flag immediately for DataWedge scans.
  • Update DataWedge profile configuration to use the app’s runtime bundle ID and to send config as JSON strings to preserve DataWedge’s expected “all values are strings” behavior.
  • Split/clarify DataWedge config constants into getProfileConfig(...) and INTENT_OUTPUT_CONFIG.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/screens/SortationPutaway/PutawayTaskListScreen.tsx Switches enteredManually tracking from state to a ref to correctly classify DataWedge scan submissions.
src/hooks/useScanListener.ts Adjusts DataWedge profile setup to use runtime bundle ID and sends profile config via JSON strings for correct native parsing.
src/hooks/constant.ts Refactors DataWedge config constants to support dynamic package names and intent output configuration with string-only values.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@awalkowiak

Copy link
Copy Markdown
Contributor

@olewandowski1 could you review this sometime this week?

@olewandowski1

Copy link
Copy Markdown
Collaborator Author

@jmiranda @awalkowiak I just tested it on the emulator, all works as expected. Scan path takes me directly to the Putaway Qty screen, manual path redirects to Putaway Product and the validation scan is required. In that case I believe we're good to go.

@awalkowiak
awalkowiak merged commit c7bbd54 into develop Sep 3, 2026
2 checks passed
@awalkowiak
awalkowiak deleted the OBLS-936 branch September 3, 2026 07:38
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.

5 participants