Skip to content

Staging back merge#82

Merged
jeffmaki merged 2 commits into
developfrom
staging
Jul 9, 2026
Merged

Staging back merge#82
jeffmaki merged 2 commits into
developfrom
staging

Conversation

@jeffmaki

@jeffmaki jeffmaki commented Jul 9, 2026

Copy link
Copy Markdown
Contributor
  • Fixed OSM change parsing to await parseOsmChangeXml(...) in both the export archive builder and OsmApiClient.getOsmChange, ensuring parsed change data is fully resolved before use.
  • Added unit coverage for OsmApiClient.getOsmChange with MSW, verifying the downloaded XML is parsed correctly and timestamps are normalized to Date objects.
  • Added TypeScript typings for @osmcha/osmchange-parser, declaring its async default export as parseOsmChangeXml(xmlString: string): Promise<OsmChange>.

@jeffmaki jeffmaki merged commit 47c7cf5 into develop Jul 9, 2026
1 of 2 checks passed
@jeffmaki jeffmaki changed the title Staging Staging back merge Jul 9, 2026
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ebf5ca32-30b1-49c1-86f0-72c220c78fd9

📥 Commits

Reviewing files that changed from the base of the PR and between ab3b4f1 and da98a1f.

📒 Files selected for processing (4)
  • services/export/tdei.ts
  • services/osm.ts
  • test/unit/services/osm.test.ts
  • types/osmchange-parser.d.ts

📝 Walkthrough

Walkthrough

This PR fixes a missing await on parseOsmChangeXml calls in services/osm.ts and services/export/tdei.ts, which previously returned unresolved promises. The type declaration for @osmcha/osmchange-parser is updated to reflect its async signature, and unit tests are added for getOsmChange.

Changes

Async OSM changeset parsing fix

Layer / File(s) Summary
Type declaration for parseOsmChangeXml
types/osmchange-parser.d.ts
Declares the default export of @osmcha/osmchange-parser as an async function returning Promise<OsmChange> instead of an untyped module.
Await parseOsmChangeXml in OSM client and export archive
services/osm.ts, services/export/tdei.ts
Adds await before parseOsmChangeXml calls in getOsmChange and in the changeset archive builder so the resolved parsed object is used instead of an unresolved promise.
Unit tests for getOsmChange parsing
test/unit/services/osm.test.ts
Adds MSW-based test scaffolding, an OSM change XML fixture, and tests verifying parsed element structure, tag mapping, and timestamp normalization.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Test
  participant MSW
  participant OsmApiClient
  participant parseOsmChangeXml
  Test->>MSW: stubDownload registers changeset download route
  Test->>OsmApiClient: getOsmChange()
  OsmApiClient->>MSW: downloadOsmChange request
  MSW-->>OsmApiClient: OSM_CHANGE_XML response
  OsmApiClient->>parseOsmChangeXml: await parse(xml)
  parseOsmChangeXml-->>OsmApiClient: osmChange object
  OsmApiClient-->>Test: parsed osmChange
Loading

Poem

A missing "await" left promises hanging,
This bunny hopped in, no more mangling!
Now XML parses, timestamps align,
Tests confirm every node and tag is fine.
🐇✨ Hop on, changesets, all resolved and set!


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant