fix(file-service): restore share notification publishing - #258
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Co-Authored-By: bot_apk <apk@cognition.ai>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
| fn dockerfile_enables_share_event_failure(dockerfile: &str) -> bool { | ||
| let dockerfile = dockerfile.replace("\\\r\n", " ").replace("\\\n", " "); | ||
|
|
||
| dockerfile | ||
| .lines() | ||
| .map(str::trim) | ||
| .filter_map(|line| { | ||
| let (instruction, rest) = line.split_once(char::is_whitespace)?; | ||
| instruction | ||
| .eq_ignore_ascii_case("ENV") | ||
| .then_some(rest.trim_start()) | ||
| }) | ||
| .any(|env| { | ||
| if env.contains('=') { | ||
| env.split_whitespace().any(|assignment| { | ||
| assignment | ||
| .strip_prefix("FILE_SHARE_EVENT_ALWAYS_FAIL=") | ||
| .is_some_and(|value| parse_bool(value.trim_matches(['"', '\'']), false)) | ||
| }) | ||
| } else { | ||
| env.strip_prefix("FILE_SHARE_EVENT_ALWAYS_FAIL") | ||
| .is_some_and(|value| { | ||
| value.starts_with(char::is_whitespace) | ||
| && parse_bool(value.trim().trim_matches(['"', '\'']), false) | ||
| }) | ||
| } | ||
| }) | ||
| } |
There was a problem hiding this comment.
📝 Info: Regression guard covers the relevant ENV forms
dockerfile_enables_share_event_failure joins continuations and parses both ENV KEY=value and ENV KEY value forms, handling quotes, case, comments, and prefix collisions like FILE_SHARE_EVENT_ALWAYS_FAIL_OTHER. The primary reintroduction form is covered.
Was this helpful? React with 👍 or 👎 to provide feedback.
Runtime verificationSharing
Pre-existing local noise observed outside this path: unrelated queued messages with null |
Summary
file-serviceimages forcedFILE_SHARE_EVENT_ALWAYS_FAIL=true, so everyfile_sharedpublish substituted the configured SNS topic with a nonexistent-v2ARN. Shares returned errors, were not reliably recorded, and recipients missed notifications.SnsConfig::from_env()retains its safe default andEventPublisher::file_shared()publishes toSNS_TOPIC_ARN.ENVsyntax variants.cargo fmt --check, all 26 Rust tests, andcargo clippy --all-targets -- -D warnings.file-servicewithout the override; browser share returned success and persisted after reload, the API returned 201, the share row persisted, andnotification-serviceconsumed thefile_sharedevent from the configuredotterworks-eventstopic. Logs contained no-v2ARN or publish failures.This is an independent reproduction and fix from
main; related investigations: #253 and #254. This run adds syntax-aware regression coverage for both key/value and assignment-form Dockerfile environment declarations.Link to Devin session: https://app.devin.ai/sessions/eca7fa9335614cbda9ebe95da1757522
Devin Review