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

Clarify the distinction between exchangeId and localExchangeId #425

Open
jrhender opened this issue Oct 3, 2024 · 3 comments
Open

Clarify the distinction between exchangeId and localExchangeId #425

jrhender opened this issue Oct 3, 2024 · 3 comments

Comments

@jrhender
Copy link
Contributor

jrhender commented Oct 3, 2024

When calling Create Exchange, an exchangeId is returned. However, the Participate in an Exchange endpoint has a localExchangeId URL path parameter.

Looking at the Exchange Example, my assumption is that the Create Exchange endpoint was only called once. I think this must be the case as there is a single workflowId 123 and a workflow can only have single possible starting step.
Therefore, on might expect there to be a single exchangeId for the interactions in the example. However, the localExchangeId changes in the example from 123 to abc. I see the following possible explanations:

  1. localExchangeId is intended to be different from the exchangeId. In other words, a "local exchange" is essentially an instance of workflow step which is associated with the parent exchange. If this the case, it is unclear how the localExchangeId is determined (e.g. by the Owner Coordinator to pass to the client of the exchange).
  2. localExchange is the same as exchangeId and the change from 123 to abc is a mistake.

I think that further discussion and explanatory text on this point would be helpful for implementors of the workflow features.

@dlongley
Copy link
Contributor

dlongley commented Oct 8, 2024

In short, an exchange has two IDs, a fully qualified one (full URL) and a relative one (just the "slug" or "path" part). I don't think we want two different properties in the data model of exchanges for this -- and that we just want the relative value to be returned, i.e., exchange.id == '<relative exchange ID>'.

We will need a separate name to describe the relative ID when talking about it as a URL path parameter, however, because it needs to be distinguished from other slugs/path params like the relative workflow ID (which appears in the full exchange ID URL).

We do need to fix up the YAML files that describe what information is returned when creating an exchange. I believe there should be an id field that holds the relative ID only (slug only, i.e., "localExchangeId" or the relative "path" parameter value) and that we should remove the exchangeId property. We should only use the name exchangeId, I think, if we're expressing information that isn't in an exchange itself. This would be consistent with how we use credentialId to refer to a fully qualified (full URL) to identify a credential, but the ID doesn't appear in the credential.

We need to settle on a name for what we're calling the "slug"/"path" thing that appears in the URL / routes as a local/relative identifier for the exchange. Maybe we even want to use "relative" in name for that.

jrhender added a commit that referenced this issue Oct 9, 2024
As this example is a single exchange, the exchange id should be the same in both participate calls.
See issue #425 for discussion.
@jrhender
Copy link
Contributor Author

jrhender commented Oct 9, 2024

Ok, thanks for the clarification @dlongley . Your points make sense to me 👍 .

I think then that the exchange example should adjusted to have the same localExchangeId for both of the participate calls. PR here to implement this: #427

msporny pushed a commit that referenced this issue Oct 22, 2024
As this example is a single exchange, the exchange id should be the same in both participate calls.
See issue #425 for discussion.
@msporny
Copy link
Contributor

msporny commented Oct 22, 2024

The group discussed this on the 2024-10-22 call and believed that more text would need to be written, specifically the following two things need terms that we use consistently in the spec:

  • A path parameter or a relative component in a URL (local exchange ID)
  • Fully qualified URL (exchange ID)

The group will need to have further discussions on this item on a future call.

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