-
Notifications
You must be signed in to change notification settings - Fork 549
feat(client-presence): Create Acknowledgment message interface and ackRequested
flow
#24470
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
feat(client-presence): Create Acknowledgment message interface and ackRequested
flow
#24470
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces an acknowledgement message interface for client presence to facilitate acknowledgement responses when clients join.
- Added a new constant for the acknowledgement message type and its corresponding interface.
- Extended the message type union in helper functions and added a branch in the message handler to accommodate the new acknowledgement messages.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…Habi/FluidFramework into presence-ack-message-type
packages/framework/presence/src/test/presenceDatastoreManager.spec.ts
Outdated
Show resolved
Hide resolved
packages/framework/presence/src/test/presenceDatastoreManager.spec.ts
Outdated
Show resolved
Hide resolved
I was wrong about the utility of having passing acceptance of an Ack message. There isn't any time a client should receive an Ack without asking for one. We can follow up elsewhere on what logic we should put out sooner in Teams.
ackRequested
flow
ackRequested
flowackRequested
flow
public setTargetSignalSupport(supported: boolean): void { | ||
if (supported) { | ||
this.supportedFeatures.add("submit_signals_v2"); | ||
} else { | ||
this.supportedFeatures.delete("submit_signals_v2"); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For future use? I don't see reference to this.?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I assumed in the future we'd want something like this to test behavior of both flows (broadcast join vs targeted join behavior).
packages/runtime/container-runtime-definitions/src/containerExtension.ts
Outdated
Show resolved
Hide resolved
packages/runtime/container-runtime-definitions/src/containerExtension.ts
Outdated
Show resolved
Hide resolved
packages/framework/presence/src/datastorePresenceManagerFactory.ts
Outdated
Show resolved
Hide resolved
packages/framework/presence/src/datastorePresenceManagerFactory.ts
Outdated
Show resolved
Hide resolved
}; | ||
} | ||
|
||
type AcknowledgmentIdType = string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nits:
- It is a type. You don't need to say
Type
in the name. - Move before it is used. (English reading order.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oof right just saw this, will have a follow up fixing this
…ckRequested` flow (microsoft#24470) ## Description For Presence to leverage targeted signals, an acknowledgement mechanism will most likely be needed. This change reserves space for such messages in protocol and introduces an `acknowledgementID` field alongside messages that require acknowledgment. When a client receives a message with an `acknowledgementID` then they respond with a targeted ack messsage containing the corresponding `id`. `acknowledgementId` is typed as `number` and will be a simple increasing counter. This is sufficient for local uniqueness. This PR also passes down `supportedFeatures` property from runtime to PresenceDatastoreManager, to allow Presence to know whether targeted signal capability is available. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…crosoft#24753) ## Description Addresses nit in microsoft#24470
Description
For Presence to leverage targeted signals, an acknowledgement mechanism will most likely be needed. This change reserves space for such messages in protocol and introduces an
acknowledgementID
field alongside messages that require acknowledgment. When a client receives a message with anacknowledgementID
then they respond with a targeted ack messsage containing the correspondingid
.acknowledgementId
is typed asnumber
and will be a simple increasing counter. This is sufficient for local uniqueness.This PR also passes down
supportedFeatures
property from runtime to PresenceDatastoreManager, to allow Presence to know whether targeted signal capability is available.