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

lifetimeMS Separate Argument B/C? #1002

Open
thegreatfatzby opened this issue Jan 23, 2024 · 3 comments
Open

lifetimeMS Separate Argument B/C? #1002

thegreatfatzby opened this issue Jan 23, 2024 · 3 comments

Comments

@thegreatfatzby
Copy link
Contributor

Hello fwends, I was commenting on one of our PRs internally which led to a conversation about how to tell the call to joinAdInterestGroup what the lifetime is. I now see that the Github doc lists lifetimeMs as being one of the properties of the object passed to the call, rather than the second argument; I also see this in the full spec. However we found that the old method seems supported based on both this doc and experiments.

So QQs:

  • Is the intention for this to stay backwards compatible for a while?
  • What will be the behavior on updateUrl if the lifetimeMs comes back? I would assume it will either not change the expiration date OR will take the MIN of the previous date and what the new date would be.
@michaelkleber
Copy link
Collaborator

The lifetimeMs property of the Interest Group is the new and suggested way to do things. It's a good match for other web standards, which use milliseconds instead of seconds for basically everything else where you specify some duration in the browser.

The old second-argument-in-seconds technique will be supported for a while as a fallback, for backwards compatibility.

The behavior if you call Join a second time is just like it was before: it sets the lifetime of the IG to whatever you say it should be, overwriting whatever the previous expiration was. In this way you can keep extending the lifetime of an IG until 30 days after the person most recently visited the site where you're invoking the Join operation.

@thegreatfatzby
Copy link
Contributor Author

Thanks @michaelkleber that makes sense, can I just confirm the behavior of how this works when lifetimeMs is returned in the response from a call to updateUrl:

  • You can adjust the lifetime as much as you want within the 30 days after last visit restriction?
  • Will the lifetimeMs returned via updateUrl be relative to t = lastVisit or t = timeOfUpdate? I.e. if the original lifetimeMs=5Days, and on day lastVisit + 4 your updateUrl returns lifetimeMs=10Days, will that cause it to go to lastVisit + 10Days or lastVisit + 14Days?

@MattMenke2
Copy link
Contributor

Updates ignore the lifetimeMs field, so they can't extend (or shorten) the lifetime of an interest group. Not allowing extending the field is a deliberate behavior, to avoid an interest group to be persisted indefinitely from a single site visit. Only a script on a page the user visits can extend the lifetime of an IG.

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

No branches or pull requests

3 participants