Skip to content

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

Merged
merged 21 commits into from
Jun 2, 2025

Conversation

WillieHabi
Copy link
Contributor

@WillieHabi WillieHabi commented Apr 28, 2025

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.

@Copilot Copilot AI review requested due to automatic review settings April 28, 2025 18:10
Copy link
Contributor

@Copilot Copilot AI left a 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.

@github-actions github-actions bot added area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct base: main PRs targeted against main branch labels Apr 28, 2025
@WillieHabi WillieHabi changed the title feat(client-presenece): Create Acknowldegment message interface feat(client-presence): Create Acknowledgment message interface Apr 28, 2025
@WillieHabi WillieHabi marked this pull request as draft April 29, 2025 06:39
@WillieHabi WillieHabi requested a review from jason-ha April 29, 2025 13:23
@WillieHabi WillieHabi marked this pull request as ready for review April 29, 2025 13:23
jason-ha
jason-ha previously approved these changes May 5, 2025
@jason-ha jason-ha changed the title feat(client-presence): Create Acknowledgment message interface feat(client-presence): Create stub Acknowledgment message interface May 5, 2025
@jason-ha jason-ha dismissed their stale review May 5, 2025 04:07

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.

@WillieHabi WillieHabi changed the title feat(client-presence): Create stub Acknowledgment message interface feat(client-presence): Create stub Acknowledgment message interface and ackRequested flow May 13, 2025
@WillieHabi WillieHabi marked this pull request as draft May 13, 2025 16:41
@WillieHabi WillieHabi marked this pull request as ready for review May 13, 2025 20:18
@WillieHabi WillieHabi requested a review from jason-ha May 13, 2025 21:30
@WillieHabi WillieHabi marked this pull request as draft May 13, 2025 23:25
@WillieHabi WillieHabi changed the title feat(client-presence): Create stub Acknowledgment message interface and ackRequested flow feat(client-presence): Create Acknowledgment message interface and ackRequested flow May 14, 2025
@WillieHabi WillieHabi marked this pull request as ready for review May 14, 2025 16:26
@WillieHabi WillieHabi requested a review from jason-ha May 15, 2025 21:03
Comment on lines 141 to 147
public setTargetSignalSupport(supported: boolean): void {
if (supported) {
this.supportedFeatures.add("submit_signals_v2");
} else {
this.supportedFeatures.delete("submit_signals_v2");
}
}
Copy link
Contributor

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.?

Copy link
Contributor Author

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).

@WillieHabi WillieHabi requested a review from jason-ha May 21, 2025 22:29
@github-actions github-actions bot added the area: runtime Runtime related issues label May 28, 2025
@github-actions github-actions bot added the dependencies Pull requests that update a dependency file label Jun 2, 2025
@WillieHabi WillieHabi requested a review from jason-ha June 2, 2025 17:11
};
}

type AcknowledgmentIdType = string;
Copy link
Contributor

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.)

Copy link
Contributor Author

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

@WillieHabi WillieHabi merged commit 8a2d212 into microsoft:main Jun 2, 2025
33 checks passed
WillieHabi added a commit that referenced this pull request Jun 2, 2025
MarioJGMsoft pushed a commit to MarioJGMsoft/FluidFramework that referenced this pull request Jun 10, 2025
…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>
MarioJGMsoft pushed a commit to MarioJGMsoft/FluidFramework that referenced this pull request Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct area: runtime Runtime related issues base: main PRs targeted against main branch dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants