Skip to content

Saving files with sessionToken #1057

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 1 commit into from
Jan 10, 2020
Merged

Saving files with sessionToken #1057

merged 1 commit into from
Jan 10, 2020

Conversation

dplewis
Copy link
Member

@dplewis dplewis commented Jan 8, 2020

Closes: #1049

A small optimization with saving files in saveAll.
Clean up deferred promises.

@stevestencil Can you check and see if this works for you?

Let me know if anything else is needed.

Closes: #1049

A small optimization with saving files in saveAll.
Clean up deferred promises.
@codecov
Copy link

codecov bot commented Jan 8, 2020

Codecov Report

Merging #1057 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1057      +/-   ##
==========================================
- Coverage   92.19%   92.18%   -0.01%     
==========================================
  Files          54       54              
  Lines        5150     5146       -4     
  Branches     1145     1148       +3     
==========================================
- Hits         4748     4744       -4     
  Misses        402      402
Impacted Files Coverage Δ
src/promiseUtils.js 91.48% <ø> (ø) ⬆️
src/RESTController.js 84% <100%> (-0.22%) ⬇️
src/ParseObject.js 89.38% <100%> (-0.06%) ⬇️
src/TaskQueue.js 87.5% <100%> (-1.79%) ⬇️
src/ParseFile.js 96.84% <100%> (+0.12%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 77e4068...74fd982. Read the comment docs.

@dplewis dplewis requested review from acinader and davimacedo January 8, 2020 23:50
@stevestencil
Copy link
Contributor

I noticed that when saving the files by using request() (instead of ajax()) it sets the session token as "_SessionToken" in the body. With this change you're setting the session token in the header X-Parse-Session-Token. Unless I'm missing something, shouldn't these use one or the other?

@dplewis
Copy link
Member Author

dplewis commented Jan 10, 2020

Looking here Both of these have existed since the beginning of parse. One represents the REST API with headers the other represents POST request with (headers included in data). In this case SaveFile is using REST style request so for consistency I'm using REST style header here.

I'm not really sure why they used ajax() instead of request() here, maybe there was a side-effect. We can try it in a separate PR. @acinader Thoughts?

For now does this work for you?

@acinader
Copy link
Contributor

@dplewis this change looks good to me. I'd prefer to keep what you've done with the session in the header where we now expect it and wouldn't make a requirement for adding this important capability cleaning up a log established inconsistency (unless you want to that is).

@dplewis dplewis merged commit dd36493 into master Jan 10, 2020
@dplewis dplewis deleted the file-sessionToken branch January 10, 2020 23:05
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

Successfully merging this pull request may close these issues.

Saving a file does not pass in session token
3 participants