Skip to content

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

Open
olewandowski1 wants to merge 2 commits into
developfrom
OBLS-936
Open

OBLS-936 Fix duplicate product scan in sorted putaway on DataWedge scans#444
olewandowski1 wants to merge 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
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.

4 participants