Skip to content
Snippets Groups Projects
Commit 0048a971 authored by Art Lowel's avatar Art Lowel
Browse files

fix issue where submission requests would time out before they could be used once

parent afa61b11
No related branches found
No related tags found
No related merge requests found
......@@ -59,12 +59,11 @@ describe('SubmissionRestService test suite', () => {
describe('getDataById', () => {
it('should configure a new SubmissionRequest', () => {
const expected = new SubmissionRequest(requestService.generateRequestId(), resourceHref);
// set cache time to zero
expected.responseMsToLive = 0;
expected.forceBypassCache = true;
scheduler.schedule(() => service.getDataById(resourceEndpoint, resourceScope).subscribe());
scheduler.flush();
expect(requestService.removeByHrefSubstring).toHaveBeenCalledWith(resourceHref);
expect(requestService.configure).toHaveBeenCalledWith(expected);
});
});
......
......@@ -109,11 +109,10 @@ export class SubmissionRestService {
filter((href: string) => isNotEmpty(href)),
distinctUntilChanged(),
map((endpointURL: string) => new SubmissionRequest(requestId, endpointURL)),
map ((request: RestRequest) => {
request.responseMsToLive = 0;
return request;
tap((request: RestRequest) => {
this.requestService.removeByHrefSubstring(request.href);
this.requestService.configure(request);
}),
tap((request: RestRequest) => this.requestService.configure(request)),
flatMap(() => this.fetchRequest(requestId)),
distinctUntilChanged());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment