I am experiencing a significant connection latency regression in react-native-esc-pos-printer starting from version v4.4.4 and continuing in the latest v4.5.0.
Summary
v4.3.3 and below
await printer.connect() completes in less than 1 second
Printing is fast and works reliably
However, these versions have a 16 KB buffer/data limitation on Android, which causes issues for larger print jobs and also creates Android publishing / policy-related constraints, making them unsuitable for production Android builds
v4.4.4 and above (including v4.5.0)
The 16 KB Android data limitation appears to be resolved
But await printer.connect() consistently takes 6–8 seconds
This delay happens before any actual print command is executed
The latency is high enough to noticeably impact POS user experience
Impact
In a POS environment, a 6–8 second delay during printer connection is not acceptable, especially when printing receipts frequently.
At the moment, developers are forced to choose between:
Fast connection (≤ v4.3.3) with 16 KB Android data and publishing limitations, or
Correct Android-compatible data handling (≥ v4.4.4) with severe connection latency
Expectation
Ideally:
Connection time should remain close to v4.3.3 performance (less than 1 second)
While retaining the fixes introduced in v4.4.4 and above for Android-safe larger data handling
Demo component (used in a fresh app):
const printer = new Printer({
target: printerData.target,
deviceName: printerData.deviceName,
});
await printer.addQueueTask(async () => {
logTime(3);
await printer.connect(); // latency occurs here
logTime(4);
await printer.addTextAlign(PrinterConstants.ALIGN_CENTER);
await printer.addText('PRINT DEMO\n');
await printer.addCut(PrinterConstants.CUT_FEED);
const result = await printer.sendData();
await printer.disconnect();
return result;
});
Steps to reproduce
- Install react-native-esc-pos-printer v4.4.4 or later (issue also reproducible on v4.5.0).
- Set up a reachable ESC/POS TCP printer on a local network.
- Use the demo code provided in the description (no retries, no tryToConnectUntil).
- Launch the app on a real device (Android or iOS).
- Start printer discovery using usePrintersDiscovery.
- Select a discovered printer and trigger print.
- Observe the console logs.
- logTime(3) is printed immediately.
- logTime(4) appears 6–8 seconds later.
- Note that no print commands are executed during this delay; it occurs only during await printer.connect().
- Comparison step (optional but confirming)
- Downgrade the library to v4.3.3.
- Repeat steps 3–8.
- Observe that printer.connect() completes in less than 1 second, but large print jobs fail due to the 16 KB Android limitation and publishing constraints.
- react-native-esc-pos-printer version
4.5.0
React Native version
0.82.1
Platforms
Android, iOS
Workflow
None
Architecture
None
Build type
None
Device
None
Device model
No response
Acknowledgements
Yes
I am experiencing a significant connection latency regression in react-native-esc-pos-printer starting from version v4.4.4 and continuing in the latest v4.5.0.
Summary
v4.3.3 and below
await printer.connect() completes in less than 1 second
Printing is fast and works reliably
However, these versions have a 16 KB buffer/data limitation on Android, which causes issues for larger print jobs and also creates Android publishing / policy-related constraints, making them unsuitable for production Android builds
v4.4.4 and above (including v4.5.0)
The 16 KB Android data limitation appears to be resolved
But await printer.connect() consistently takes 6–8 seconds
This delay happens before any actual print command is executed
The latency is high enough to noticeably impact POS user experience
Impact
In a POS environment, a 6–8 second delay during printer connection is not acceptable, especially when printing receipts frequently.
At the moment, developers are forced to choose between:
Fast connection (≤ v4.3.3) with 16 KB Android data and publishing limitations, or
Correct Android-compatible data handling (≥ v4.4.4) with severe connection latency
Expectation
Ideally:
Connection time should remain close to v4.3.3 performance (less than 1 second)
While retaining the fixes introduced in v4.4.4 and above for Android-safe larger data handling
Demo component (used in a fresh app):
Steps to reproduce
4.5.0
React Native version
0.82.1
Platforms
Android, iOS
Workflow
None
Architecture
None
Build type
None
Device
None
Device model
No response
Acknowledgements
Yes