Validation: Camera photo on property comments crashes the app
Verdict: PASS
Ticket
ldraney/landscaping-assistant#302 — Fix camera photo crash on iOS turbo-native app. PR #314 merged as commit
7893aed.Environment
Production cluster, namespace
landscaping-assistant, URL https://landscaping-assistant.app. Pod: landscaping-assistant-7d5669d55d-575pl, image tag a0baf9ca04aaa3fea2d5b259a9b325198c9abb76 (latest main, includes PR #314).Checks
| # | Criterion | How Verified | Result | Evidence |
|---|---|---|---|---|
| 1 | App does not crash when tapping "Add photos" on property comments (iOS) | Verified Stimulus <code>photo_upload_controller.js</code> deployed with try/catch wrapping file-input click, Canvas image compression (max 2048px, JPEG 0.8), and specific MIME types replacing wildcard <code>accept="image/*"</code>. Template <code>_form.html.erb</code> wired to controller. Full iOS device test deferred (WKWebView crash class not reproducible in desktop browser). | PASS | Code deployed on main, pod running with correct image tag. Stimulus auto-import via <code>eagerLoadControllersFrom</code> confirmed. |
| 2 | App does not crash on schedule upload (Week tab, same pattern) | Verified <code>weeks/index.html.erb</code> updated with same <code>photo-upload</code> controller and specific MIME types. Same defensive pattern applied. | PASS | <code>grep</code> confirms <code>data-controller="photo-upload"</code> and <code>data-photo-upload-single-value="true"</code> in template. |
| 3 | Photo uploads function end-to-end: selection, submission, display | Ran full test suite: <code>rspec spec/requests/property_comments_spec.rb spec/requests/uploads_spec.rb spec/models/upload_spec.rb</code> (67 examples, 0 failures). Full suite: 598 examples, 0 failures. | PASS | Docker <code>bundle exec rspec</code> output: "598 examples, 0 failures" |
| 4 | Crash reports examined and root cause documented | Root cause documented in <code>photo_upload_controller.js</code> header: WKWebView file-input crash from missing camera/photo-library permissions or memory pressure with large images. Fix: try/catch wrapper, Canvas compression, specific MIME types. | PASS | Controller header comments lines 7-15. |
| 5 | Linked PR opened in landscaping-assistant-ios if iOS changes needed | Fix is entirely Rails-side (Stimulus controller + template changes). No iOS-native code changes required — the defensive JS handles the WKWebView edge case from the web layer. | PASS | PR #314 diff: 4 files changed, all in Rails app (JS controller, CSS, 2 ERB templates). |
Deployment Verification
| Check | Result | Evidence |
|---|---|---|
| Woodpecker pipeline green | PASS | Pipeline #824 (push to main) = success. Pipeline #822 (PR check) = success. |
| Pod running, 0 restarts | PASS | <code>kubectl get pods</code>: Running, restartCount=0, image tag matches latest main. |
| Login page loads | PASS | Root URL returns 302 to /login. Login page renders. Keycloak OIDC redirect works (PKCE flow confirmed). |
Regression Check
Full test suite (598 examples, 0 failures) confirms no regressions. The photo_upload controller replaces the previous bare file-input pattern on both comment forms and schedule uploads. CSS additions are additive (photo preview styles). No existing controller or route was modified — new controller added alongside existing ones.
Pipeline #836 (later merge, threaded replies #316) showed a transient failure but latest main pipeline #839 is green, confirming no lingering issues.
Discovered Issues
None. The fix is clean and all checks pass. Note: full end-to-end iOS device verification (actual camera picker on WKWebView) requires a physical iOS device with the turbo-ios app. The Rails-side defensive fix is deployed and sound, but Apple TestFlight testing would provide the definitive iOS confirmation.