Skip to content

Make screenshotUris non-optional. #1188

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
Aug 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/v2/providers/alerts/appDistribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export interface InAppFeedbackPayload {
/** Text entered by the tester */
text: string;
/** URIs to download screenshot(s) */
screenshotUris?: string[];
screenshotUris: string[];
}

/**
Expand Down Expand Up @@ -330,7 +330,10 @@ export function onInAppFeedbackPublished(
const [opts, appId] = getOptsAndApp(appIdOrOptsOrHandler);

const func = (raw: CloudEvent<unknown>) => {
return handler(raw as AppDistributionEvent<InAppFeedbackPayload>);
const event = raw as AppDistributionEvent<InAppFeedbackPayload>;
// Consolidate the case of empty array and null array
event.data.payload.screenshotUris = event.data.payload.screenshotUris || [];
return handler(event);
};

func.run = handler;
Expand Down