mirror of
https://github.com/sudosylabs/vnidrop.git
synced 2026-08-05 02:29:55 +02:00
feat(apple): notify the sender when a receiver's delivery fails
plannedReceiverNotifications only fired for completed receivers, so a failed delivery produced no notification. Add a receiverFailed kind wired through the planner, id, and deliver paths, with localized notifications_receiver_failed_* strings and a unit test.
This commit is contained in:
@@ -41,4 +41,11 @@ final class TransferNotificationTests: XCTestCase {
|
||||
let requests = [Fixtures.request(id: "a", requestedAt: 1, status: .completed)]
|
||||
XCTAssertTrue(plannedReceiverNotifications(requests, published: ["receiver-completed-a"]).isEmpty)
|
||||
}
|
||||
|
||||
func testReceiverNotificationsFireForFailedReceivers() {
|
||||
let requests = [Fixtures.request(id: "x", requestedAt: 1, status: .failed)]
|
||||
let planned = plannedReceiverNotifications(requests, published: [])
|
||||
XCTAssertEqual(planned.map(\.id), ["receiver-failed-x"])
|
||||
XCTAssertEqual(planned.first?.kind, .receiverFailed)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user