Skip to content

Commit bebfdfc

Browse files
authored
fix: filter out drafts - WPB-19863 (#4195)
1 parent cbe421a commit bebfdfc

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

WireMessaging/Sources/WireMessagingData/WireCells/NodesAPI/NodesAPI.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ package final actor NodesAPI: NodesAPIProtocol, WireCellsNodesRepositoryProtocol
155155
) async throws -> (nodes: [WireCellsNode], nextOffset: Int?) {
156156
do {
157157
let (nodes, nextOffset) = try await restAPI.getNodes(request)
158-
return (nodes: nodes.map { $0.toDomainModel() }, nextOffset: nextOffset)
158+
return (nodes: nodes.filter { !$0.isDraft }.map { $0.toDomainModel() }, nextOffset: nextOffset)
159159
// user not yet created, wire users are "lazily" sync to pydio users the first time they are part of a cells
160160
// conversation
161161
} catch let error as CellsSDK.ErrorResponse where error.httpStatusCode == 401 {

WireMessaging/Sources/WireMessagingData/WireCells/NodesAPI/RestAPI.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ private extension WireCellsGetNodesRequest {
473473
request.filters = RestLookupFilter(
474474
status: LookupFilterStatusFilter(
475475
deleted: .not,
476-
isDraft: false
476+
isDraft: false // Backend filtering is not available; filtering is handled on the client side.
477477
),
478478
text: lookupFilterTextSearch,
479479
type: .unknown // .unknown includes files (leafs) & folders (collections)
@@ -486,7 +486,7 @@ private extension WireCellsGetNodesRequest {
486486
request.filters = RestLookupFilter(
487487
status: LookupFilterStatusFilter(
488488
deleted: .only,
489-
isDraft: false
489+
isDraft: false // Backend filtering is not available; filtering is handled on the client side.
490490
),
491491
type: .unknown // .unknown includes files (leafs) & folders (collections)
492492
)
@@ -501,7 +501,7 @@ private extension WireCellsGetNodesRequest {
501501
term: tags.joined(separator: ",")
502502
)], status: LookupFilterStatusFilter(
503503
deleted: .not,
504-
isDraft: false
504+
isDraft: false // // Backend filtering is not available; filtering is handled on the client side.
505505
),
506506
text: LookupFilterTextSearch(searchIn: .baseName, term: searchTerm ?? "*"),
507507
type: .leaf
@@ -516,7 +516,7 @@ private extension WireCellsGetNodesRequest {
516516
request.filters = RestLookupFilter(
517517
status: LookupFilterStatusFilter(
518518
deleted: .not,
519-
isDraft: false
519+
isDraft: false // Backend filtering is not available; filtering is handled on the client side.
520520
),
521521
type: .collection
522522
)

0 commit comments

Comments
 (0)