Skip to content

Commit 51c1fa5

Browse files
Fix/bubble io stale extra data (#1110)
2 parents ad7e4cb + d2b9b14 commit 51c1fa5

File tree

6 files changed

+17
-5
lines changed

6 files changed

+17
-5
lines changed

apps/api/src/app/import-jobs/usecase/update-userjob/update-userjob.command.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { IFilter } from '@impler/shared';
2+
13
export class UpdateUserJobCommand {
24
url: string;
35

@@ -12,4 +14,6 @@ export class UpdateUserJobCommand {
1214
status: string;
1315

1416
nextRun?: Date;
17+
18+
filters?: IFilter[];
1519
}

apps/queue-manager/src/consumers/send-bubble-data.consumer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export class SendBubbleDataConsumer extends BaseConsumer {
202202
const emailContents = this.emailService.getEmailContent({
203203
type: 'ERROR_SENDING_BUBBLE_DATA',
204204
data: {
205-
error: JSON.stringify(data.error, null, 2).replace(/\\+"/g, '"'),
205+
error: JSON.stringify(data.error, null, 2)?.replace(/\\+"/g, '"') ?? 'Error while sending data to Bubble',
206206
importName,
207207
time: data.callDate.toString(),
208208
bubbleAppUrl: bubbleData.bubbleAppUrl,

apps/web/pages/imports/[id].tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ function ImportDetails() {
5656
accessToken: profileInfo?.accessToken,
5757
onUploadComplete: onSpreadsheetImported,
5858
authHeaderValue: webhookConfig.authHeaderValue || '',
59-
extra: webhookConfig.extra || '',
6059
appearance: {
6160
widget: {
6261
backgroundColor: '#1c1917',
@@ -97,7 +96,9 @@ function ImportDetails() {
9796
onConfigSubmit={(config: { authHeaderValue?: string; extra?: string }) => {
9897
setWebhookConfig(config);
9998
modals.closeAll();
100-
showWidget();
99+
showWidget({
100+
extra: config.extra || '',
101+
});
101102
setTimeout(() => {}, 100);
102103
}}
103104
/>

apps/widget/src/components/widget/Phases/AutoImport/AutoImportPhase3/AutoImportPhase3.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ interface IAutoImportPhase3Props {
2222

2323
const getDefaultValuesForFrequency = (frequency: AUTOIMPORTSCHEDULERFREQUENCY): Partial<RecurrenceFormData> => {
2424
const now = new Date();
25+
now.setMinutes(now.getMinutes() + 5);
2526
const defaultTime = `${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}`;
2627

2728
const baseDefaults = {

packages/client/src/types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,11 @@ export interface IUseImplerProps {
223223
* In future versions, the `primaryColor` property will be moved under `appearance` object.
224224
*/
225225
primaryColor?: string;
226+
/**
227+
* @deprecated Use the `extra` parameter in `showWidget()` instead.
228+
* Example: `showWidget({ extra: { your: 'data' } })`
229+
* In future versions, the `extra` property will be removed and `showWidget({ extra: { your: 'data' } })` will be the only way to pass extra data.
230+
*/
226231
extra?: string | Record<string, any>;
227232
config?: WidgetConfig;
228233
appearance?: AppearanceConfig;

packages/react/src/hooks/useImpler.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export function useImpler({
99
authHeaderValue,
1010
title,
1111
texts,
12-
extra,
12+
extra: defaultExtra,
1313
config,
1414
maxRecords,
1515
appearance,
@@ -85,7 +85,8 @@ export function useImpler({
8585
sampleFile,
8686
schema,
8787
output,
88-
}: Pick<IShowWidgetProps, 'colorScheme' | 'data' | 'schema' | 'output' | 'sampleFile'> = {}) => {
88+
extra = defaultExtra,
89+
}: Pick<IShowWidgetProps, 'colorScheme' | 'data' | 'schema' | 'output' | 'sampleFile' | 'extra'> = {}) => {
8990
if (window.impler && isImplerInitiated) {
9091
const payload: IShowWidgetProps & { uuid: string; host: string } = {
9192
uuid,

0 commit comments

Comments
 (0)