chore: clear shutdown noise and compiler warnings - #12
Conversation
EventStore.Storage.Lock and EventStore.Storage.Database never call any Logger.* function, so `require Logger` triggers an "unused require Logger" warning on Elixir 1.20. Removing it since it has no effect on behavior. (cherry picked from commit 364bf7d228be2cd5752f8b374eadaf23711bc289) Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Elixir 1.20's type checker can't prove `recorded_event` (destructured
from the {recorded_event, index} tuple produced by Enum.with_index/2)
is a %RecordedEvent{} at the point it's used in a struct update:
warning: a struct for EventStore.RecordedEvent is expected on
struct update
map_to_recorded_event/3 always returns %RecordedEvent{}, so this is a
type-checker visibility gap, not a real bug — pattern-matching
%RecordedEvent{} in the anonymous function head makes the invariant
explicit and resolves the warning.
(cherry picked from commit a9f3b6e360d9ed7a3f3e9ae9486a88ec2bec4923)
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
In our testsuit we observed the following logs producing noise: `[info] Postgrex.Protocol (#PID<0.867.0>) disconnected: ** (DBConnection.ConnectionError) client #PID<0.868.0> exited`. They seem to be cause by calling `Application.stop(:eventstore)` at the end of our test case. The root cause appears to be the hard kill that `AdvisoryLocks` experiences without the ability to checkin a currently held `DBConnection`. Trapping exits is sufficient to allow for a normal connection checkin before termination. (cherry picked from commit d4cc6c3fec8c938965f82613e3e63ec307a40bb3) Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
(cherry picked from commit d7ce76d46facb372ac057bb0fa74b3c7c5b1b8c1) Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
PR SummaryLow Risk Overview Compiler hygiene: unused Stream append typing: Reviewed by Cursor Bugbot for commit 0cc11a9. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
Warning Review limit reachedNext included review available in 3 seconds. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Cherry-picked from commanded/eventstore#317 (
d4cc6c3,d7ce76d, FinOpsTech Bot and Silvan Büdenbender) and commanded/eventstore#326 (364bf7d,a9f3b6e, @wimwian).