Changeset comment feature + notes comment feature#88
Conversation
|
Warning Review limit reached
Next review available in: 23 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughComment posting now reports failures while preserving drafts, refreshes changeset discussions, and optimistically updates note discussions. OSM client requests use encoded query parameters, note parsing is refactored, and Nuxt development proxy settings are expanded. ChangesComment flow updates
Development server routing
Estimated code review effort: 3 (Moderate) | ~25 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@nuxt.config.ts`:
- Around line 31-32: Remove the newly added trailing commas from the devServer
configuration and the additional changed entries around the corresponding
configuration block in nuxt.config.ts, following the project’s
no-trailing-commas style.
- Around line 52-56: Update the Vite server configuration in nuxt.config.ts to
remove allowedHosts: true and keep host validation enabled by using the default
empty list or an explicit allowlist. Support additional tunnel hosts through the
__VITE_ADDITIONAL_SERVER_ALLOWED_HOSTS environment variable.
In `@services/osm.ts`:
- Around line 59-78: Guard against missing comments in noteFeatureToEntity by
defaulting properties.comments to an empty array before iterating. Update the
comments access in the loop and returned OsmNote so undefined feature properties
or comments never cause iteration to throw.
- Around line 462-501: Remove the duplicate postNoteComment method in
services/osm.ts. Keep the Promise<void> implementation that posts the encoded
text query parameter, and delete or rename the later JSON-returning
implementation so only one method with this signature remains.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b8f25c48-b8f8-4be4-b6f1-cfb7157f534b
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (5)
components/review/Discussion.vuenuxt.config.tsservices/osm.tstest/e2e/review.spec.tstest/unit/services/osm.test.ts
| function noteFeatureToEntity(feature: Feature): OsmNote { | ||
| const geometry = feature.geometry as Point; | ||
| const properties = feature.properties ?? { }; | ||
|
|
||
| for (const comment of properties.comments) { | ||
| comment.date = new Date(comment.date); | ||
| } | ||
|
|
||
| notes.push({ | ||
| id: properties.id, | ||
| status: properties.status, | ||
| lat: geometry.coordinates[1] ?? 0, | ||
| lon: geometry.coordinates[0] ?? 0, | ||
| created_at: new Date(properties.date_created), | ||
| comments: properties.comments, | ||
| }); | ||
| for (const comment of properties.comments) { | ||
| comment.date = new Date(comment.date); | ||
| } | ||
|
|
||
| return notes; | ||
| return { | ||
| id: properties.id, | ||
| status: properties.status, | ||
| lat: geometry.coordinates[1] ?? 0, | ||
| lon: geometry.coordinates[0] ?? 0, | ||
| created_at: new Date(properties.date_created), | ||
| comments: properties.comments, | ||
| }; | ||
| } | ||
|
|
||
| function notesGeoJsonToEntities(geoJson: FeatureCollection): OsmNote[] { | ||
| return geoJson.features.map(noteFeatureToEntity); |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Guard against undefined properties.comments
When feature.properties is undefined, the ?? { } fallback yields an empty object, but properties.comments is then undefined and for (const comment of undefined) throws a TypeError. Add a defensive fallback to [].
🛡️ Proposed fix
function noteFeatureToEntity(feature: Feature): OsmNote {
const geometry = feature.geometry as Point;
const properties = feature.properties ?? { };
- for (const comment of properties.comments) {
+ for (const comment of properties.comments ?? []) {
comment.date = new Date(comment.date);
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| function noteFeatureToEntity(feature: Feature): OsmNote { | |
| const geometry = feature.geometry as Point; | |
| const properties = feature.properties ?? { }; | |
| for (const comment of properties.comments) { | |
| comment.date = new Date(comment.date); | |
| } | |
| notes.push({ | |
| id: properties.id, | |
| status: properties.status, | |
| lat: geometry.coordinates[1] ?? 0, | |
| lon: geometry.coordinates[0] ?? 0, | |
| created_at: new Date(properties.date_created), | |
| comments: properties.comments, | |
| }); | |
| for (const comment of properties.comments) { | |
| comment.date = new Date(comment.date); | |
| } | |
| return notes; | |
| return { | |
| id: properties.id, | |
| status: properties.status, | |
| lat: geometry.coordinates[1] ?? 0, | |
| lon: geometry.coordinates[0] ?? 0, | |
| created_at: new Date(properties.date_created), | |
| comments: properties.comments, | |
| }; | |
| } | |
| function notesGeoJsonToEntities(geoJson: FeatureCollection): OsmNote[] { | |
| return geoJson.features.map(noteFeatureToEntity); | |
| function noteFeatureToEntity(feature: Feature): OsmNote { | |
| const geometry = feature.geometry as Point; | |
| const properties = feature.properties ?? { }; | |
| for (const comment of properties.comments ?? []) { | |
| comment.date = new Date(comment.date); | |
| } | |
| return { | |
| id: properties.id, | |
| status: properties.status, | |
| lat: geometry.coordinates[1] ?? 0, | |
| lon: geometry.coordinates[0] ?? 0, | |
| created_at: new Date(properties.date_created), | |
| comments: properties.comments, | |
| }; | |
| } | |
| function notesGeoJsonToEntities(geoJson: FeatureCollection): OsmNote[] { | |
| return geoJson.features.map(noteFeatureToEntity); |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@services/osm.ts` around lines 59 - 78, Guard against missing comments in
noteFeatureToEntity by defaulting properties.comments to an empty array before
iterating. Update the comments access in the loop and returned OsmNote so
undefined feature properties or comments never cause iteration to throw.
AZDO #3967 and #3966
Summary