tsdav icon indicating copy to clipboard operation
tsdav copied to clipboard

client.smartCollectionSync detailedResult can't be passed as true

Open swkoyo opened this issue 3 years ago • 1 comments

Hey there,

It seems there's a bug within the type declaration. The function smartCollectionSync doesn't allow detailedResult to be passed as true (can only be passed as undefined or false).

image image

When I set it to true as false, the expected response is received.

image image

The documentation shows that detailedResult can be passed as true so I assume this should be valid. I'm not familiar with caldav so I might be making the wrong assumption though.

swkoyo avatar Sep 16 '22 08:09 swkoyo

Thanks for suggestions, I'll investigate it and get back to you soon.

On Fri, Sep 16, 2022 at 16:41 Brandon Kim @.***> wrote:

Hey there,

It seems there's a bug within the type declaration. The function smartCollectionSync doesn't allow detailedResult to be passed as true (can only be passed as undefined or false).

[image: image] https://user-images.githubusercontent.com/10441291/190595035-70594992-6aa6-4e34-89ef-b99bf860310b.png [image: image] https://user-images.githubusercontent.com/10441291/190595113-2f7459f6-894d-452a-939e-e409d17d68e5.png

When I set it to true as false, the expected response is received.

[image: image] https://user-images.githubusercontent.com/10441291/190595271-90eeedb1-5406-44f2-a39a-8e277367d48e.png [image: image] https://user-images.githubusercontent.com/10441291/190595306-cd3fd09f-c6d6-4064-b382-640cee25a0c1.png

The documentation shows that detailedResult can be passed as true so I assume this should be valid. I'm not familiar with caldav so I might be making the wrong assumption though.

— Reply to this email directly, view it on GitHub https://github.com/natelindev/tsdav/issues/131, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACG4GTQEYUBYXI6RKAMMOJTV6QXBXANCNFSM6AAAAAAQODXW4U . You are receiving this because you are subscribed to this thread.Message ID: @.***>

natelindev avatar Sep 16 '22 10:09 natelindev

cannot repo sample code used to repo, no error occurred.


const icalCalendar = {
  url: 'https://example.com/calendars/icalendar.ics',
};
const icalData: DAVObject[] = [];

(async () => {
  const data = await smartCollectionSync({
    collection: {
      ...icalCalendar,
      objects: icalData,
    },
    method: 'webdav',
    detailedResult: false,
  });
})();

both true and false should be able to be passed in.

natelindev avatar Feb 10 '24 13:02 natelindev