Skip to content

feat: add code for querying the /teams/notifications endpoint - WPB-24947#4661

Open
caldrian wants to merge 1641 commits into
developfrom
fix/discovering-apps-in-large-teams-WPB-24947
Open

feat: add code for querying the /teams/notifications endpoint - WPB-24947#4661
caldrian wants to merge 1641 commits into
developfrom
fix/discovering-apps-in-large-teams-WPB-24947

Conversation

@caldrian
Copy link
Copy Markdown
Contributor

@caldrian caldrian commented Apr 30, 2026

BugWPB-24947 [iOS] When adding apps to conversation only local store is searched

Issue

This PR adds networking code for the /teams/notifications endpoint.
It's not yet used, a follow-up PR will finish that.


Checklist

  • Title contains a reference JIRA issue number like [WPB-XXX].
  • Description is filled and free of optional paragraphs.
  • Adds/updates automated tests.

UI accessibility checklist

If your PR includes UI changes, please utilize this checklist:

  • Make sure you use the API for UI elements that support large fonts.
  • All colors are taken from WireDesign.ColorTheme or constructed using WireDesign.BaseColorPalette.
  • New UI elements have Accessibility strings for VoiceOver.

caldrian and others added 30 commits June 13, 2025 06:55
…9-3fd2c79caa49237a3a843dc23b51e1d29b8d847f' into chore/analytics-setup-refactoring-WPB-17530
…/analytics-setup-refactoring-WPB-17530-part2
Co-authored-by: Jullian Mercier <31648126+jullianm@users.noreply.github.com>
Co-authored-by: Christoph Aldrian <caldrian@users.noreply.github.com>
Co-authored-by: Christoph Aldrian <christoph.aldrian@wire.com>
Co-authored-by: Jullian Mercier <31648126+jullianm@users.noreply.github.com>
…#3221)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Christoph Aldrian <caldrian@users.noreply.github.com>
Co-authored-by: Jullian Mercier <31648126+jullianm@users.noreply.github.com>
…8-ab7a03e6b6f178cf4372cb7b54baf9f81d1e22ff' into chore/include-nse-logs-WPB-15114
caldrian added 22 commits May 4, 2026 15:31
Copy link
Copy Markdown
Collaborator

@netbe netbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left some comments before approving

struct TeamNotificationsResponseV5: Decodable, ToAPIModelConvertible {

let notifications: [TeamNotificationV5]
let time: UTCTime?
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's maybe the servertime, not sure. Something related to calling so we can calculate the age of call events

.init(
element: notifications.flatMap { $0.toAPIModel() },
hasMore: hasMore ?? false,
nextStart: notifications.last?.id.transportString() ?? ""
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please report to backend to know if this is expected.

Comment thread WireNetwork/Sources/WireNetwork/APIs/Rest/TeamsAPI/TeamsAPIV5.swift
@wireapp wireapp deleted a comment from Copilot AI May 4, 2026
Copy link
Copy Markdown
Contributor

@jullianm jullianm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I left one comment about project structure specifically II think we should keep the notifications decoding & responses objects introduced in v5 closer to the TeamsAPIV5 object.

// along with this program. If not, see http://www.gnu.org/licenses/.
//

struct PaginatedTeamNotificationsResponseV5: Decodable, ToAPIModelConvertible {
Copy link
Copy Markdown
Contributor

@jullianm jullianm May 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this PR introduced two new folders: EventDecoding and Responses at the top level to process the payload from the notifications endpoint however these models are only related to TeamsAPIV5. From a project structure standpoint, I find it confusing as in other API components we keep these models close to the API version its related to.

I would suggest to either move them to TeamsAPIV5 or create a folder named TeamsAPIV5 which contains these models including the TeamsAPIV5.swift file.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to align the structure with the UpdateEventsAPI code:

Image

I think it's too much code to be put into a single file and creating a directory TeamsAPIV5 is something we haven't done before if I'm not mistaken.

What do you think, can we leave it like this?


import Foundation

struct TeamNotificationV5: Decodable {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this decodable model should be closer to the API version it was introduced in (TeamsAPIV5) see my other comment.

@sonarqubecloud
Copy link
Copy Markdown

@caldrian caldrian requested a review from netbe May 12, 2026 14:55
Copy link
Copy Markdown
Collaborator

@netbe netbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, left a suggestion

.init(
element: notifications.flatMap { $0.toAPIModel() },
hasMore: hasMore ?? false,
nextStart: notifications.last?.id.transportString() ?? ""
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: ok maybe worth adding a comment for this in the public header

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants