Fix story backups mock test & read-receipt setting restoration

Co-authored-by: trevor-signal <131492920+trevor-signal@users.noreply.github.com>
This commit is contained in:
automated-signal 2024-08-28 18:17:37 -05:00 committed by GitHub
parent 12032b839a
commit a04e0a4616
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 15 additions and 4 deletions

View file

@ -617,10 +617,14 @@ export class BackupImportStream extends Writable {
'hasStoriesDisabled', 'hasStoriesDisabled',
accountSettings?.storiesDisabled === true accountSettings?.storiesDisabled === true
); );
// an undefined value for storyViewReceiptsEnabled is semantically different from
// false: it causes us to fallback to `read-receipt-setting`
await storage.put( await storage.put(
'storyViewReceiptsEnabled', 'storyViewReceiptsEnabled',
accountSettings?.storyViewReceiptsEnabled === true accountSettings?.storyViewReceiptsEnabled ?? undefined
); );
await storage.put( await storage.put(
'hasCompletedUsernameOnboarding', 'hasCompletedUsernameOnboarding',
accountSettings?.hasCompletedUsernameOnboarding === true accountSettings?.hasCompletedUsernameOnboarding === true

View file

@ -4,6 +4,7 @@
import createDebug from 'debug'; import createDebug from 'debug';
import Long from 'long'; import Long from 'long';
import { Proto, StorageState } from '@signalapp/mock-server'; import { Proto, StorageState } from '@signalapp/mock-server';
import { expect } from 'playwright/test';
import { generateStoryDistributionId } from '../../types/StoryDistributionId'; import { generateStoryDistributionId } from '../../types/StoryDistributionId';
import { MY_STORY_ID } from '../../types/Stories'; import { MY_STORY_ID } from '../../types/Stories';
@ -224,6 +225,9 @@ describe('backups', function (this: Mocha.Suite) {
debug('Opening story privacy'); debug('Opening story privacy');
await window.locator('.StoriesTab__MoreActionsIcon').click(); await window.locator('.StoriesTab__MoreActionsIcon').click();
await window.getByRole('button', { name: 'Story Privacy' }).click(); await window.getByRole('button', { name: 'Story Privacy' }).click();
await expect(
window.locator('.StoriesSettingsModal__overlay')
).toHaveCSS('opacity', '1');
await snapshot('story privacy'); await snapshot('story privacy');
}, },

View file

@ -481,7 +481,10 @@ export class Bootstrap {
const window = await app.getWindow(); const window = await app.getWindow();
await callback(window, async (name: string) => { await callback(window, async (name: string) => {
debug('creating screenshot'); debug('creating screenshot');
snapshots.push({ name, data: await window.screenshot() }); snapshots.push({
name,
data: await window.screenshot(),
});
}); });
let index = 0; let index = 0;
@ -512,7 +515,7 @@ export class Bootstrap {
{} {}
); );
if (numPixels === 0) { if (numPixels === 0 && !process.env.FORCE_ARTIFACT_SAVE) {
debug('no screenshot difference'); debug('no screenshot difference');
return; return;
} }

View file

@ -80,7 +80,7 @@ export type StorageAccessType = {
hasSeenGroupStoryEducationSheet: boolean; hasSeenGroupStoryEducationSheet: boolean;
hasViewedOnboardingStory: boolean; hasViewedOnboardingStory: boolean;
hasStoriesDisabled: boolean; hasStoriesDisabled: boolean;
storyViewReceiptsEnabled: boolean; storyViewReceiptsEnabled: boolean | undefined;
identityKeyMap: IdentityKeyMap; identityKeyMap: IdentityKeyMap;
lastAttemptedToRefreshProfilesAt: number; lastAttemptedToRefreshProfilesAt: number;
lastResortKeyUpdateTime: number; lastResortKeyUpdateTime: number;