fix: resolve XML attributes, URL resolution, client API gaps, and exports - #280
Merged
Merged
Conversation
…orts - Propagate XML root element attributes properly in davRequest and makeCollection - Ensure trailing slashes on base URLs when resolving relative hrefs and object filenames - Robustly parse principal and home set hrefs (arrays, objects, strings) - Guard type helpers hasFields and findMissingFieldNames against null/undefined - Expose freeBusyQuery method on DAVClient and createDAVClient return object - Export missing public symbols and overload types in index.ts - Fix documentation typo and eliminate pnpm 10 deprecation warnings
natelindev
had a problem deploying
to
Production
September 18, 2026 16:55 — with
GitHub Actions
Error
natelindev
had a problem deploying
to
Production
September 18, 2026 16:55 — with
GitHub Actions
Error
natelindev
had a problem deploying
to
Production
September 18, 2026 16:55 — with
GitHub Actions
Error
natelindev
had a problem deploying
to
Production
September 18, 2026 16:55 — with
GitHub Actions
Failure
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
This PR addresses several latent bugs and inconsistencies identified during a repository-wide audit:
1. XML Attribute Propagation & Root Namespaces
davRequestplacedinit.attributesat the document root level ({ _declaration, _attributes, ...body }), whichxml-jsin compact mode ignores. Custom namespaces and attributes passed ininit.attributeswere dropped. Furthermore,makeCollectionomitted root DAV namespace attributes on<mkcol>.init.attributesinto each root element ofbodyindavRequest(merging with existing element attributes). Added standard DAV namespaces tobody.mkcol._attributesinmakeCollection.2. Relative URL Resolution & Trailing Slashes
https://example.com/cal/user), WHATWGnew URL('1.ics', base)resolution treated the final path segment as a filename and dropped it, resulting in incorrect target paths (https://example.com/cal/1.ics).ensureTrailingSlashhelper and applied it acrossaccount,calendar,addressBook, andcollectionwhen resolving relative hrefs, child object URLs, and collection paths.3. Account Href Extraction Robustness
fetchPrincipalUrlandfetchHomeUrlonly accepted pure strings for hrefs. CalDAV/CardDAV servers returning{ _cdata: string }or arrays of hrefs (RFC 4791 allows multi-valuedcalendar-home-set) resulted incannot find homeUrl/cannot find principalUrl.extractHrefsupporting strings, CDATA objects, and arrays.4. Calendar & AddressBook Query Edge Cases
fetchCalendarObjectsandfetchVCards, empty or whitespace hrefs causednew URL()to throw uncaught exceptions.useMultiGet: falseandobjectUrlswas specified,calendarObjectResultswas not filtered to match the requestedobjectUrls.objectUrlswhenuseMultiGet: false.5. Client API Completeness (
freeBusyQuery)freeBusyQuerywas exported from./calendarbut omitted from bothcreateDAVClientandDAVClient.freeBusyQuerytocreateDAVClientreturn object andDAVClientclass.6. Public Exports & Type Declarations
serviceDiscovery,fetchPrincipalUrl,fetchHomeUrl,urlMatches,ensureTrailingSlash,excludeHeaders,mergeHeaders,ICALObjects) and sync overload types were not re-exported fromsrc/index.ts.src/index.ts. Added comprehensive export verification tests insrc/__tests__/unit/index.test.ts.7. Type Helper Null Safety
nullorundefinedtohasFieldsorfindMissingFieldNamescaused uncaughtTypeError: Cannot convert undefined or null to object.8. Tooling & Documentation
pnpm.overridesconfiguration emitted warnings under pnpm 10; docs typo infetchCalendarObjects(calendarObjectUrlsinstead ofobjectUrls).pnpm.overridesto rootoverridesin both root anddocs/package.json, and fixed the documentation typo.Verification
pnpm lintpassed with 0 errors.pnpm typecheckpassed with 0 errors.pnpm buildcompleted successfully.pnpm --dir docs testpassed with 0 errors.