Questions about CACAO expiry

I’m trying to understand CACAO and the expiry. I’ve been told that documents CACAO expires by design, and I’m trying to understand a bit the implications of this. By document I mean something created from a Composite. It would help me greatly if you could answer the following:

  • Is it true that if a document is left un-edited for a certain amount of time, the CACAO will always expire?
  • Is the only way to prevent CACAO from expiring to have the user that created the document make an edit to the document before the expiry time is up?
  • Is there a way to un-expire the CACAO once it’s expired?
  • Where is it possible to set a longer CACAO expiry time?

Thanks a lot! :slight_smile:

CACAO and documents are not necessarily dependent on each other, you can think of CACAO just like a session bearer token, your blockchain account authorizes the session to write on that accounts behalf for some agreed time and then is not longer valid, like a typical user session, and then you ask the user to create a new session again

did-session configuration docs describe how to change/set the expiry time, default is one day right now - Module: did-session | Decentralized Identifiers (DIDs)

Thanks for your response. I’m still a bit unclear on how CACAO and documents do interact though. For example if I leave a document unedited for a certain amount of time (e.g. 2 days), I get the response that the CACAO has expired. This to me seems like a rather large flaw when building an application that should hold user generated data.

For example, if a user creates a document (say, a blog post) then after X days they can’t edit it ever again. Is this correct? And if so, how would you propose to get around this limitation? As in my opinion it’s not feasible that an app doesn’t provide the ability to edit something.

Separate question - is it possible to have multiple users be able to edit the same document?

yeah they dont interact really, other than a session allows you to just sign on behalf of your blockchain account

a document doesnt become invalid/expired, just a session, but it does sound like you unfortunately ran into a recent network issue we had where some documents where not anchored before the cacao expired and became permanently invalid, and it would look the way you described. This is not the expected behavior, nor should continue going forward.

not possible to have multiple users edit the same document, but at a view layer you may be able to “merge” two documents depending on your use case, or model it to look that way. But any conflicts/ordering would have to be handled on your end specific to your application.

hope that helps!

Ah okay that’s super helpful, thank you!

We did experience the issue where documents weren’t anchored, and it does seem to have improved.

I think though based on your advice we have a solution for our problems. It would be to store an internal ID and a revision time on each document. We’d only ever show the latest revision of a document using the time and ID.

If a user encounters either the CACAO issue (just in case it were to ever happen) or if they are unable to edit a document as they didn’t create it, we’d just create a new document with an updated revision time. The app will only ever show the latest revision. This should resolve our problems.

Thanks again!