Skip to content

Releases: SHcommit/SHFirestoreService

[Fix] Change combine operator to run in background

03 May 05:49
Compare
Choose a tag to compare

[Fix]

The combine operator execution codes of existing Service internal functions set subscribe(on:), but it was confirmed that the operators were executed by accumulating in the main thread call stack😅.

I confirmed the concept of subscribe(on:) once again through the official document, and added backgroundQueue to process operators asynchronously with receive(on:).😅😎🤩🥳

[Feat] Now, requestDTO is available in dictionary format😄

03 May 03:21
Compare
Choose a tag to compare

[Feature]

  • previously, When saving or updating a document, only requestDTO of encodable type could be used.
    • As a drawback of this, the Firestore type FieldValue does not support encodable, so an encoding error will occur if this type is declared in an encodable object.

Now By adding a dictionary format to requestDTO, you can use it to update or set a specific document even when using FieldValue.

[Feat] Add transaction call function

02 May 14:03
Compare
Choose a tag to compare

[Feature]

  • Added transaction call function. Firestore ServiceError is emitted when a transaction fails.

[Rebuild]

  • I separated the FirestoreService Protocol into a little composition.

[Feat] In request(endpoint:), when the FiresotreMethod case is save, the logic is separated into the saveDocument(endpoint:) function.

01 May 17:02
Compare
Choose a tag to compare

[Feature]

In the previous request (endpoint:), if the output publisher's value was Void, the FirestoreMethod case processed three things: save, upate, and delete.

What's new!

[saveDocument(endpoint:)]

  • In the case of endpoint's firestore method save, the role is now separated from request(endpoint:) -> AnyPublisher<Void, FirestoreServiceError> to saveDocument(endopint:).
  • When saving an existing document, an invalidRequestDTO error is thrown if there is no requestDTO in the endpoint.
    • Now, added a document with an empty field value depending on whether there is an associated value of FirestoreMethod case save or not.
  • When using saveDocumetn(endpoint:), The ID of the created document is returned as the output publisher's string value.

[backgroundQueue]

  • By default, you have specified a background queue for work to be processed by a background thread.
    • However, if it is not already the main thread at the time you call the service from outside, you can specify a backgroundQueue at init time to run in that thread's queue.

[Fix] ver1.1.9. Modified FirestoreService's retriecveDocumentIDs(endpoint:)

01 May 15:28
Compare
Choose a tag to compare

Previous release v1.1.8(link) operates normally.

However, �I decided that it would be better to specify the publisher's output value using the parameter type of FirestoreService's retrieceDocumentIDs(endpoint:) "E.ResponseDTO", so improved the output type.

[Feat] v 1.1.8. Added a function to get a list of document IDs from a specific collection.

01 May 14:39
Compare
Choose a tag to compare

[Reason]

When retrieving the document ID of a specific collection, if there is no field value in the document, a decoding error will throw if FirestoreMethod = case .get is used. The error reason is "A document not found".

[Feature]

  • retrieveDocumentIDs(endpoint:E)-> AnyPublisher<[String],FirestoreServiceError>

If specify a collectionReference's location for accepting FIrestoreAccessible in specific endopint instance, Now can retrieve a list of document ID list within that collection ref, whether that's specific document's fields exist or not: ) without throwing error "A document not found."

[Feat] Add logic to return an empty string in FirestoreService.request(endpoint:)

01 May 13:07
Compare
Choose a tag to compare

[Feature]

public func request<D, E>(
    endpoint: E
  ) -> AnyPublisher<[D], FirestoreServiceError>
  where D == E.ResponseDTO, E : FirestoreEndopintable
  • Add logic to return an empty string in FirestoreService.request(endpoint:) if the document in the collection is empty.
  • When there are no documents in the collection, we decided that it would be better to return an empty array rather than an error saying there is no document, so we modified it.

[Fix] FirestoreServiceProtocol's paginate makeQuery label type

29 Apr 14:37
Compare
Choose a tag to compare

[Fix]

  • For convenient implementation within the makeQuery closure, This release updated the FirestoreServiceProtocol's paginate method to change the makeQuery label type from FirestoreReference to CollectionReference.

[Feat] 1.1.5. Query for pagination is available

29 Apr 13:37
Compare
Choose a tag to compare

[Feature] 1.1.5 ver

  • Now query for pagination is available usgin paginate(endpoint:makeQuery:isFirstPagination:)

[Feat] 1.1.4 Now directly specific document create is avaliable or not:)

26 Apr 10:29
Compare
Choose a tag to compare
  • Add associatedValue in FirestoreMethod.save case.
  • Now directly specific document create is avaliable or not:)