Skip to content

Conversation

@laevandus
Copy link
Contributor

@laevandus laevandus commented Oct 15, 2025

🔗 Issue Links

Related: IOS-991

🎯 Goal

Separate attachments from core for easier integration in chat

📝 Summary

Provide bullet points with the most important changes in the codebase.

🛠 Implementation

Provide a detailed description of the implementation and explain your decisions if you find them relevant.

🎨 Showcase

Add relevant screenshots and/or videos/gifs to easily see what this PR changes, if applicable.

Before After
img img

🧪 Manual Testing Notes

Explain how this change can be tested manually, if applicable.

☑️ Contributor Checklist

  • I have signed the Stream CLA (required)
  • This change should be manually QAed
  • Changelog is updated with client-facing changes
  • Changelog is updated with new localization keys
  • New code is covered by unit tests
  • Documentation has been updated in the docs-content repo

@laevandus laevandus requested a review from a team as a code owner October 15, 2025 12:59
@laevandus laevandus marked this pull request as draft October 15, 2025 12:59
@github-actions
Copy link

github-actions bot commented Oct 15, 2025

1 Warning
⚠️ Big PR

Generated by 🚫 Danger

import Foundation

public final class APIError: @unchecked Sendable, Codable, JSONEncodable, Hashable, ReflectiveStringConvertible {
public final class APIError: @unchecked Sendable, Codable, Hashable, ReflectiveStringConvertible {
Copy link
Contributor Author

@laevandus laevandus Oct 15, 2025

Choose a reason for hiding this comment

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

JSONEncodable is in StreamOpenAPI at the moment. This should be refactored later, for now, I just removed this protocol conformance. APIError seems OpenAPI related but also gets imported into ClientError.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is going to be a problem for the video SDK. The api error should be json encodable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added back

@laevandus laevandus marked this pull request as ready for review October 16, 2025 07:04
@laevandus laevandus force-pushed the restructure-for-chat branch from 2699bc2 to 2bfdd08 Compare October 16, 2025 11:04
@laevandus laevandus force-pushed the restructure-for-chat branch from 2bfdd08 to ae49c8d Compare October 16, 2025 11:31
import Foundation

public final class APIError: @unchecked Sendable, Codable, JSONEncodable, Hashable, ReflectiveStringConvertible {
public final class APIError: @unchecked Sendable, Codable, Hashable, ReflectiveStringConvertible {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is going to be a problem for the video SDK. The api error should be json encodable.

@testable import StreamAttachments
import Testing

struct StreamAttachmentsTests {
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe we should have some tests to move here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense to do in a separate PR for reducing the scope of this one. Probably not going to be straight-forward thanks to all the test infrastructure on the chat side.

Package.swift Outdated
targets: ["StreamAttachments"]
),
.library(
name: "StreamOpenAPI",
Copy link
Contributor

Choose a reason for hiding this comment

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

what's the reasoning of splitting up open API stuff? Eventually chat will use it as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll think about this one. If I rename new Filter etc types then it would make things simpler. Otherwise there are naming conflicts (chat has Filter which is CoreData based).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Merged them back to a single library

@laevandus laevandus changed the title Separate attachments and OpenAPI supporting code into separate libraries Separate attachments into a separate library Oct 21, 2025
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
14.4% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@laevandus laevandus merged commit 837fa21 into develop Oct 21, 2025
5 of 6 checks passed
@laevandus laevandus deleted the restructure-for-chat branch October 21, 2025 12:50
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.

4 participants