Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Consume PublishedAt irn_subscription property #721

Merged
merged 12 commits into from
Feb 21, 2023
Merged

Conversation

llbartekll
Copy link
Contributor

Description

Consume publishedAt irn_subscription property and pass it into RequestSubscriptionPayload that is published by networking interactor

Resolves # (issue)

How Has This Been Tested?

Due Dilligence

  • Breaking change
  • Requires a documentation update

@arein arein added the accepted label Feb 16, 2023
let topic: String
let message: String
let publishedAt: Date
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to rewrite encoder code?

we can parse it as is, make it private and create computed property:

private let publishedAt: UInt64
var timestamp: Date {
return Date(milliseconds: publishedAt)
}

@@ -19,6 +48,6 @@ struct Subscription: RelayRPC {
}

init(id: String, topic: String, message: String) {
self.params = Params(id: id, data: Params.Contents(topic: topic, message: message))
self.params = Params(id: id, data: Params.Contents(topic: topic, message: message, publishedAt: Date()))
Copy link
Contributor

Choose a reason for hiding this comment

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

this used for tests?

@@ -226,7 +226,7 @@ public final class RelayClient {
try rpcHistory.set(request, forTopic: params.data.topic, emmitedBy: .remote)
logger.debug("topic \(params.data.topic)")
logger.debug("message: \(params.data.message)")
messagePublisherSubject.send((params.data.topic, params.data.message))
messagePublisherSubject.send((params.data.topic, params.data.message, params.data.publishedAt))
Copy link
Contributor

Choose a reason for hiding this comment

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

may be rename to timestamp? See comment above

@flypaper0 flypaper0 merged commit a3cdb75 into develop Feb 21, 2023
@flypaper0 flypaper0 deleted the publishedAt branch February 21, 2023 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants