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

Request priority #5737

Merged
merged 6 commits into from
Sep 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,10 @@ test.describe('Example Imagery Object', () => {
await expect(pausePlayButton).not.toHaveClass(/is-paused/);
});

test('Uses low fetch priority', async ({ page }) => {
const priority = await page.locator('.js-imageryView-image').getAttribute('fetchpriority');
await expect(priority).toBe('low');
});
});

// The following test case will cover these scenarios
Expand Down
1 change: 1 addition & 0 deletions src/plugins/imagery/components/ImageThumbnail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<img
class="c-thumb__image"
:src="image.url"
fetchpriority="low"
>
</a>
<div class="c-thumb__timestamp">{{ image.formattedTime }}</div>
Expand Down
1 change: 1 addition & 0 deletions src/plugins/imagery/components/ImageryView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
}"
:data-openmct-image-timestamp="time"
:data-openmct-object-keystring="keyString"
fetchpriority="low"
>
<div
v-if="imageUrl"
Expand Down
1 change: 1 addition & 0 deletions src/plugins/persistence/couch/CouchObjectProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ class CouchObjectProvider {
let fetchOptions = {
method,
body,
priority: 'high',
signal
};

Expand Down
6 changes: 6 additions & 0 deletions src/plugins/persistence/couch/pluginSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ describe('the plugin', () => {
expect(result.identifier.key).toEqual(mockDomainObject.identifier.key);
});

it('prioritizes couch requests above other requests', async () => {
await openmct.objects.get(mockDomainObject.identifier);
const fetchOptions = fetch.calls.mostRecent().args[1];
expect(fetchOptions.priority).toEqual('high');
});

it('creates an object and starts shared worker', async () => {
const result = await openmct.objects.save(mockDomainObject);
expect(provider.create).toHaveBeenCalled();
Expand Down