A small PR in the notification preview service needs to be reviewed. The feature should build preview strings for the user's active subscriptions and, on successful completion, increment the successful preview counter.
Behavior requirements:
build_preview accepts user_id, a list of channel_ids, and a max_items limit."<channel>: <title>".preview_count counter must increase only after the result has been fully built successfully.What to check in this PR:
cargo test run.Environment and assumptions:
cargo test is sufficient.FeedService::build_preview function and the types from src/lib.rs.Rust 1.85.0, edition 2021; no external dependencies; run via cargo test
Use line comments to explain the problem, its impact, the fix and how to test it.