Summary
Several operations swallow errors and return zero-values, so callers cannot distinguish "empty/failed silently" from success. Grouping the low-severity cases here.
Details
a. Enqueue accepts any into a BLOB NOT NULL with no type guard
queue.go:90-115 / priority_queue.go:61-91. item any is passed straight to the driver. Anything that is not []byte/string/numeric fails at the driver and Enqueue returns false with no explanation. The []byte contract is implicit.
Fix: document that item must be []byte (the adapter's contract), or assert/convert and return a typed error.
b. Read/maintenance methods discard errors
Len() queue.go:255-263 returns 0 on any error — an errored query looks like an empty queue.
Values() queue.go:266-286 returns nil on query error and silently continues on scan error.
Purge() queue.go:289-306 and Close() return nothing / drop errors.
Fix: return errors (or at minimum log them) so a failed query is not indistinguishable from an empty queue. If the varmq interface fixes these signatures, add internal logging behind the no-error facade.
Impact
Low individually, but collectively they make failures invisible and debugging hard.
Possible fix
Introduce error-returning internal variants and surface via logging where the public interface cannot change, and tighten the Enqueue contract/documentation.
Summary
Several operations swallow errors and return zero-values, so callers cannot distinguish "empty/failed silently" from success. Grouping the low-severity cases here.
Details
a.
Enqueueacceptsanyinto aBLOB NOT NULLwith no type guardqueue.go:90-115/priority_queue.go:61-91.item anyis passed straight to the driver. Anything that is not[]byte/string/numeric fails at the driver andEnqueuereturnsfalsewith no explanation. The[]bytecontract is implicit.Fix: document that
itemmust be[]byte(the adapter's contract), or assert/convert and return a typed error.b. Read/maintenance methods discard errors
Len()queue.go:255-263returns0on any error — an errored query looks like an empty queue.Values()queue.go:266-286returnsnilon query error and silentlycontinues on scan error.Purge()queue.go:289-306andClose()return nothing / drop errors.Fix: return errors (or at minimum log them) so a failed query is not indistinguishable from an empty queue. If the
varmqinterface fixes these signatures, add internal logging behind the no-error facade.Impact
Low individually, but collectively they make failures invisible and debugging hard.
Possible fix
Introduce error-returning internal variants and surface via logging where the public interface cannot change, and tighten the
Enqueuecontract/documentation.