Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1022 +/- ##
=======================================
Coverage 63.30% 63.30%
=======================================
Files 52 52
Lines 3608 3608
Branches 892 892
=======================================
Hits 2284 2284
+ Misses 1309 1243 -66
- Partials 15 81 +66 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
|
CI-green and mergeable — waiting only on a maintainer click. This PR is ready to merge, but the bot has pull-only access to this repo and can't self-merge — surfacing it here so it isn't lost. The monitoring loop will stop re-flagging it now that this note is posted. |
🤖 AI code reviewThis PR fixes the bucket detail view in src/views/Bucket.vue: it removes the fallback fake bucket object, adds a not-found alert shown after the bucket list is loaded, refreshes the bucket list once before declaring a bucket missing, and changes getEventCount to handle aw-client's unwrapped numeric response as well as the raw response for a count of 0. It also adds a new unit test file test/unit/Bucket.test.js covering the numeric count, zero count, stale-list refresh, and not-found cases. Safe to merge — no P0/P1 findingsConfidence 5/5 ✅ No thread-worthy findings. Advisory notes follow; they are retained without opening review threads. 2 advisory findings (summary-only, not scored)These P2 guard, heuristic, trade-off, or documentation claims are retained for judgment without opening review threads.
The How this was verified: Checked the template: vis-timeline and aw-eventlist are inside the v-else-if="bucket" div, so they are not rendered when notFound. The daterange watcher is defined but the input-timeinterval is also inside that div, so no daterange change can occur in not-found state. The computed is not evaluated by the template in that state.
The test 'shows a count of 0 when aw-client returns the raw response' mocks How this was verified: The test asserts eventcount is 0, which exercises the fallback branch. The mock shape matches the described aw-client behavior. Files changed (2) — the diff as I read it
Previous review passes
Reviewed Maintainer commands
|
|
@greptileai review |
| await this.getEventCount(this.id); | ||
| if (!this.bucket) { | ||
| // The cached list may predate this bucket, so refresh before calling it missing. | ||
| await this.bucketsStore.loadBuckets(); |
There was a problem hiding this comment.
| if (!this.bucket) { | ||
| // The cached list may predate this bucket, so refresh before calling it missing. | ||
| await this.bucketsStore.loadBuckets(); |
There was a problem hiding this comment.
On a cold visit to an unknown bucket, ensureLoaded() already fetches the empty bucket list. This branch fetches it again before showing “No bucket named …”, adding an unnecessary request and delay.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
- countEvents() already returns the unwrapped body, so .data was undefined and Eventcount always rendered blank. Handle aw-client 0.3.x returning the raw response for a falsy body (count 0). - An unknown bucket id rendered a fake bucket (Created = now) plus several error banners. Show a 'No bucket named X' alert instead and skip the count/events requests. - Drop a leftover console.log in bucket_with_events. Git-Session-Id: 6562
The cached bucket list can predate a bucket created after it was loaded, so a cache miss now triggers loadBuckets() before the view declares the bucket missing. Tests now emit an initial date range from the input-timeinterval stub and assert no events request for a missing bucket. Git-Session-Id: ff69
f60212e to
9305b3c
Compare
|
Rebased onto current Verified locally: |
|
@greptileai review |
Two bugs on the bucket page (Raw Data → bucket → Open), found while dogfooding v0.13.2 and reproduced on master (45e9c41).
1. Eventcount is always blank.
getEventCountread(await countEvents(id)).data. aw-client's_getalready unwraps the response body, so the call returns a number and.dataisundefined. The server answers correctly (GET /api/0/buckets/aw-watcher-window_bob/events/countreturns49828). Fix: use the value directly. Edge case: aw-client 0.3.x unwraps with(res && res.data) || res, so a count of0comes back as the raw response. That case still reads.data.2. An unknown bucket id renders a fake bucket.
#/buckets/does-not-existshowed three error banners (twoTypeErrors and the server's 404 text), an empty metadata table, andCreated: <now>. That came frombucket()falling back to{ id }. Now, once the bucket list has loaded, an unknown id shows a "No bucket named X" alert with a link back to the bucket list, and the count/events requests are skipped.Also removes a leftover
console.log(this.bucket)inbucket_with_events.Before / after
The "after" screenshots come from a production
vite buildof this branch, running against a live aw-server v0.13.2.Tests
test/unit/Bucket.test.jsmounts the view with a mocked store and client and covers three cases: a numeric count, a count of 0 returned as the raw response, and an unknown bucket. On master, the numeric-count and unknown-bucket tests fail. On this branch, all three pass.