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

[[BatchCacheOperations]] 3.3.2.5.1 is in the wrong spot and needs clarification #444

Closed
wanderview opened this issue Sep 3, 2014 · 5 comments

Comments

@wanderview
Copy link
Member

Step 3.3.2.5.1 in [[BatchCacheOperations]] currently says:

  1. If any of the values in addedRequests matches requestResponse[0], then:
    1. Throw an "InvalidStateError" exception.

First, this needs to clarify what "matches" means. In theory its logic similar to what is done in [[QueryCache]], but its poorly defined here.

Also, from talking with @jakearchibald on IRC, this should be done for each item in requestResponse as its deleted. So it needs to be moved into the loop in 3.3.2.5.2.

@jungkees
Copy link
Collaborator

jungkees commented Sep 4, 2014

The "matches" is used to compare the given value with the value of an element in the given array. And it is already being done for each item in requestResponseArray which is the result of [[QueryCache]]. In case of throwing this exception, it is intended not to run step 3.3.2.5.2. (i.e. not delete the entry.)

@wanderview
Copy link
Member Author

But requestResponse[0] only looks at the first item in requestResponse. It should be performing this check for all items in requestResponse.

@jungkees
Copy link
Collaborator

jungkees commented Sep 4, 2014

requestResponse[0] is the Request object part of the pair [Request, Response] which is the type of elements in requestResponseArray.

@wanderview
Copy link
Member Author

Ah, right. Sorry about my confusion. Thanks for clarifying for me.

@jungkees
Copy link
Collaborator

jungkees commented Sep 4, 2014

Thanks for your review and feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants