JS PR getlago/lago-agent-sdk-js#45 ends flush() with a final return this.outstanding() === 0 instead of a bare false, so a delivery that lands during the last 10ms poll sleep is still reported truthfully. Python's flush() (queue.py, merged in #25) returns a bare False after the deadline loop and can report a false negative in that window.
Port the re-check so the two repos match:
# queue.py, end of flush(), replacing `return False`
with self._lock:
return not self._buffer and self._in_flight == 0
Plus a mirror of the JS comment explaining why the last sleep can straddle the deadline. Benign divergence (false-negative direction only), but behavior must match across the ports.
JS PR getlago/lago-agent-sdk-js#45 ends
flush()with a finalreturn this.outstanding() === 0instead of a barefalse, so a delivery that lands during the last 10ms poll sleep is still reported truthfully. Python'sflush()(queue.py, merged in #25) returns a bareFalseafter the deadline loop and can report a false negative in that window.Port the re-check so the two repos match:
Plus a mirror of the JS comment explaining why the last sleep can straddle the deadline. Benign divergence (false-negative direction only), but behavior must match across the ports.