Skip to content

Conversation

@akanshaaa19
Copy link
Member

@akanshaaa19 akanshaaa19 commented Jul 3, 2025

target issue is #3344

Follow these steps to test it locally- https://docs.google.com/document/d/1g28JMBjrUhtdXrY8AGZBUJMHaasE5aD0gNDgt_aT41Q/edit?tab=t.0

Summary by CodeRabbit

New Features

Added local storage for flow definitions using IndexedDB, enabling offline access and improved data persistence.
Introduced automatic revision checks to ensure the latest flow definition is saved before publishing.
Enhanced flow publishing process with a consistency check to keep backend data up to date.

Improvements

Improved reliability of flow publishing by synchronizing recent changes within a 5-minute window.

Summary by CodeRabbit

  • New Features

    • Local caching of flow definitions via persistent storage for improved performance and offline support.
    • Automatic revision consistency checks and automatic saving of latest revisions before publishing.
    • Local cached revisions are cleaned up after successful publish.
  • Bug Fixes

    • More robust handling and logging around persistence and remote revision sync.
  • Tests

    • Enhanced tests and global mocks for persistent storage and API calls; added publish flow integration test.

@coderabbitai
Copy link

coderabbitai bot commented Jul 3, 2025

Walkthrough

Adds IndexedDB persistence for flow definitions with exported async helpers: getFlowDefinition, deleteFlowDefinition, fetchLatestRevision, and postLatestRevision. Introduces DB initialization and upgrade logic (object store keyed by uuid with a timestamp index) and guards for uninitialized DB. FlowEditor imports these helpers and dayjs, adds an async checkLatestRevision that compares timestamps and may post revisions, and makes handlePublishFlow async to await that check; publish completion now deletes local definitions. Tests add mocks for axios.get and indexedDB, adjust GraphQL mocks (publishFlowWithSuccess), and add a test spying on the new helper calls.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested reviewers

  • AmishaBisht
  • kurund

Poem

I nibble bytes in moonlit code,
Indexed burrows lined in node.
I fetch, I post, I guard the flow,
Async hops where timestamps grow.
A tiny rabbit, logs aglow. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title concisely captures the primary enhancements introduced by the pull request, namely the addition of IndexedDB persistence for flow definitions and the new revision handling logic, matching the core changes across helper functions and the FlowEditor component. It avoids vague phrasing and directly references the two main areas of work, making it clear to reviewers what significant features are being added. It does not include extraneous details or noise and accurately reflects the overall intent of the PR.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch enhancements/save-revision-before-publish

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Jul 3, 2025

@github-actions github-actions bot temporarily deployed to pull request July 3, 2025 10:35 Inactive
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (2)
src/components/floweditor/FlowEditor.tsx (1)

220-225: Consider improving type safety instead of using @ts-ignore

While @ts-ignore works for suppressing TypeScript errors, consider properly typing the files object returned from loadfiles() to avoid these suppressions.

You could define a proper type for the files object:

type LoadedFiles = Record<string, HTMLScriptElement | HTMLLinkElement>;

Then update the cleanup code:

-      Object.keys(files).forEach((node) => {
-        // @ts-ignore
-        if (files[node] && document.body.contains(files[node])) {
-          // @ts-ignore
-          document.body.removeChild(files[node]);
+      Object.keys(files).forEach((node) => {
+        const element = files[node as keyof typeof files];
+        if (element && document.body.contains(element)) {
+          document.body.removeChild(element);
         }
       });
src/components/floweditor/FlowEditor.helper.tsx (1)

196-196: Unnecessary async declaration

The function was changed to async but doesn't contain any await statements or return a Promise.

Unless you plan to add async operations to this function, consider reverting this change:

-export const loadfiles = async (startFlowEditor: any) => {
+export const loadfiles = (startFlowEditor: any) => {
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f1b1b51 and dc9f067.

📒 Files selected for processing (2)
  • src/components/floweditor/FlowEditor.helper.tsx (2 hunks)
  • src/components/floweditor/FlowEditor.tsx (3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.{ts,tsx}`: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

**/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

⚙️ Source: CodeRabbit Configuration File

List of files the instruction was applied to:

  • src/components/floweditor/FlowEditor.tsx
  • src/components/floweditor/FlowEditor.helper.tsx
🧬 Code Graph Analysis (2)
src/components/floweditor/FlowEditor.tsx (2)
src/components/floweditor/FlowEditor.helper.tsx (3)
  • fetchLatestRevision (67-77)
  • getFlowDefinition (44-65)
  • postLatestRevision (79-92)
src/mocks/Flow.tsx (1)
  • publishFlow (423-438)
src/components/floweditor/FlowEditor.helper.tsx (1)
src/config/index.ts (1)
  • FLOW_EDITOR_API (30-30)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: glific (1.18.3-otp-27, 27.3.3)
  • GitHub Check: build
  • GitHub Check: CI
🔇 Additional comments (1)
src/components/floweditor/FlowEditor.tsx (1)

22-33: LGTM!

The imports are appropriate for the new IndexedDB and revision handling functionality.

@github-actions github-actions bot temporarily deployed to pull request July 3, 2025 10:46 Inactive
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dc9f067 and 0b8f976.

📒 Files selected for processing (2)
  • src/components/floweditor/FlowEditor.helper.tsx (2 hunks)
  • src/components/floweditor/FlowEditor.test.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/floweditor/FlowEditor.helper.tsx
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.{ts,tsx}`: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

**/*.{ts,tsx}: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

⚙️ Source: CodeRabbit Configuration File

List of files the instruction was applied to:

  • src/components/floweditor/FlowEditor.test.tsx
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: glific (1.18.3-otp-27, 27.3.3)
  • GitHub Check: CI
  • GitHub Check: build
🔇 Additional comments (1)
src/components/floweditor/FlowEditor.test.tsx (1)

54-60: LGTM! Axios mock is appropriate for testing.

The axios.get mock implementation correctly provides a consistent response structure that aligns with the expected API response format, supporting the new asynchronous API calls in the FlowEditor components.

@codecov
Copy link

codecov bot commented Jul 3, 2025

Codecov Report

❌ Patch coverage is 38.88889% with 55 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.63%. Comparing base (a67e782) to head (cdb2729).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/components/floweditor/FlowEditor.helper.tsx 32.83% 44 Missing and 1 partial ⚠️
src/components/floweditor/FlowEditor.tsx 54.54% 4 Missing and 6 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3380      +/-   ##
==========================================
- Coverage   82.99%   82.63%   -0.37%     
==========================================
  Files         340      340              
  Lines       11241    11328      +87     
  Branches     2379     2396      +17     
==========================================
+ Hits         9330     9361      +31     
- Misses       1202     1249      +47     
- Partials      709      718       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cypress
Copy link

cypress bot commented Jul 3, 2025

Glific    Run #6419

Run Properties:  status check passed Passed #6419  •  git commit a90c84451d ℹ️: Merge cdb27299bb68f1f55c99b989c1f91af40af0f673 into a67e78217549adebdda24e9b3d9f...
Project Glific
Branch Review enhancements/save-revision-before-publish
Run status status check passed Passed #6419
Run duration 28m 13s
Commit git commit a90c84451d ℹ️: Merge cdb27299bb68f1f55c99b989c1f91af40af0f673 into a67e78217549adebdda24e9b3d9f...
Committer Akansha Sakhre
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 182
View all changes introduced in this branch ↗︎

@akanshaaa19 akanshaaa19 self-assigned this Jul 3, 2025
@madclaws
Copy link
Collaborator

madclaws commented Jul 7, 2025

Screen.Recording.2025-07-07.at.3.44.37.PM.mov

When i was trying to publish a flow, got logged out. Happening for newly created and existing flow.

Screenshot 2025-07-07 at 3 45 32 PM

@akanshaaa19

@akanshaaa19 akanshaaa19 requested a review from kurund July 8, 2025 03:35
@madclaws
Copy link
Collaborator

madclaws commented Jul 8, 2025

Screen.Recording.2025-07-07.at.3.44.37.PM.mov
When i was trying to publish a flow, got logged out. Happening for newly created and existing flow.

Screenshot 2025-07-07 at 3 45 32 PM @akanshaaa19

I am able to reproduce when if the floweditor is idle for sometime, and then i try to publish this happens. The authentication error happens when we try to to do GET revisions just before publish. We are not sending correct token for this req, since rest of the graphql queries are working fine. I think when we renew the token, the new one is not send with these revision apis.

@madclaws
Copy link
Collaborator

madclaws commented Jul 8, 2025

Should we cleanup the indexedDB when we are out of the floweditor?

@akanshaaa19
Copy link
Member Author

Should we cleanup the indexedDB when we are out of the floweditor?

But if someone's changes are not saved and they didn't publish, when they come back the next day and publish again the changes are lost again.

But we should decide when to clean it up

…ing; update flow definition timestamp comparison logic
@github-actions github-actions bot temporarily deployed to pull request July 14, 2025 05:06 Inactive
@akanshaaa19
Copy link
Member Author

@madclaws the logout issue is resolved

Copy link
Contributor

@kurund kurund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akanshaaa19

I am wondering if we should clear the index DB once the flow is successfully published.

@github-actions github-actions bot temporarily deployed to pull request August 6, 2025 05:15 Inactive
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (3)
src/components/floweditor/FlowEditor.helper.tsx (3)

91-114: Critical: Missing save function still unaddressed

While the fetch function implementation looks good with proper error handling and authentication, the IndexedDB implementation is still incomplete without a save function. The getFlowDefinition will always return null unless data is saved elsewhere.

You still need to implement a saveFlowDefinition function to make the IndexedDB functionality complete:

export const saveFlowDefinition = async (
  uuid: string,
  definition: any,
  timeStamp: string
): Promise<boolean> => {
  const db = dbInstance || (await initDB());
  if (!db) {
    setLogs('Database not initialized. Call initDB() first.', 'error');
    return false;
  }

  return new Promise((resolve, reject) => {
    const transaction = db.transaction([STORE_NAME], 'readwrite');
    const store = transaction.objectStore(STORE_NAME);
    const request = store.put({ uuid, definition, timeStamp });

    request.onsuccess = () => resolve(true);
    request.onerror = () => reject(new Error('Failed to save flow definition'));
  });
};

104-106: Inefficient sorting implementation remains

The reduce approach for finding the latest revision is still inefficient and could be error-prone. As mentioned in past comments, sorting would be more reliable.

Consider this more efficient approach:

-    if (data.results.length > 0) {
-      latestRevision = data.results.reduce((latest: any, current: any) => {
-        return new Date(latest.created_on) > new Date(current.created_on) ? latest : current;
-      });
-    }
+    if (data.results.length > 0) {
+      latestRevision = data.results.sort((a: any, b: any) => 
+        new Date(b.created_on).getTime() - new Date(a.created_on).getTime()
+      )[0];
+    }

116-117: Type safety concerns persist

The function still uses any type for the definition parameter, which reduces type safety as noted in past reviews.

Consider improving type safety:

-export const postLatestRevision = async (uuid: string, definition: any) => {
+interface FlowDefinition {
+  [key: string]: any; // or more specific structure if known
+}
+
+export const postLatestRevision = async (uuid: string, definition: FlowDefinition): Promise<boolean> => {
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9b06d85 and ce7138f.

📒 Files selected for processing (2)
  • src/components/floweditor/FlowEditor.helper.tsx (2 hunks)
  • src/components/floweditor/FlowEditor.tsx (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/floweditor/FlowEditor.tsx
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}

⚙️ CodeRabbit Configuration File

Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

Files:

  • src/components/floweditor/FlowEditor.helper.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: CI
  • GitHub Check: glific (1.18.3-otp-27, 27.3.3)
🔇 Additional comments (6)
src/components/floweditor/FlowEditor.helper.tsx (6)

7-8: LGTM: Authentication service imports added

The addition of getAuthSession import aligns with the authentication token handling mentioned in the PR objectives and addresses the authentication issues that were previously reported.


12-43: IndexedDB initialization looks solid

The database initialization follows IndexedDB best practices with proper error handling, singleton pattern, and schema management. The upgrade handling correctly creates the object store and index.


45-66: LGTM: Proper error handling in getFlowDefinition

The function correctly initializes the database if needed and handles both success and error cases appropriately.


68-89: Good implementation of delete functionality

The delete function properly handles database initialization and includes appropriate error handling with descriptive error messages.


94-99: Authentication token handling improved

Good to see the authentication token is now properly retrieved and included in the headers. This should address the logout issues mentioned in the PR comments.


116-138: Good error handling in postLatestRevision

The function properly handles authentication tokens and includes comprehensive error handling. The use of fetch instead of axios is consistent with the fetchLatestRevision function.

};

export const loadfiles = (startFlowEditor: any) => {
export const loadfiles = async (startFlowEditor: any) => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Function signature change needs verification

The loadfiles function has been changed from synchronous to asynchronous, but the internal implementation remains synchronous. This could break existing callers.

Verify that all callers of loadfiles have been updated to handle the async nature:


🏁 Script executed:

#!/bin/bash
# Search for all usages of loadfiles function
rg -A 3 -B 3 "loadfiles\(" --type ts --type tsx

Length of output: 77


🏁 Script executed:

#!/bin/bash
# Search for all usages of loadfiles across TS/TSX files
rg -A 3 -B 3 "loadfiles\(" -g "*.ts" -g "*.tsx" || echo "No occurrences found."

Length of output: 535


Ensure callers handle loadfiles’ async return

The loadfiles function now returns a Promise, but its caller in FlowEditor.tsx still treats it as synchronous:

• File: src/components/floweditor/FlowEditor.tsx
Around the useEffect:

useEffect(() => {
  if (flowId) {
-     const files = loadfiles(() => {
+     (async () => {
+       const files = await loadfiles(() => {
        getFreeFlow({ variables: { id: flowId } });
      });
+       // …use files here…
+     })();
  }
}, [flowId]);

Please update this (and any other) call site to either await the async function or chain with .then(...), and adjust the useEffect body accordingly so you’re working with the resolved value instead of a Promise.

🤖 Prompt for AI Agents
In src/components/floweditor/FlowEditor.tsx near the useEffect hook, the call to
the async function loadfiles from FlowEditor.helper.tsx is currently treated
synchronously. Update the useEffect callback to either use an async function
with await when calling loadfiles or use loadfiles(...).then(...) to handle the
Promise resolution properly. This ensures the code works with the resolved value
instead of the Promise itself.

@github-actions github-actions bot temporarily deployed to pull request August 6, 2025 06:29 Inactive
@github-actions github-actions bot temporarily deployed to pull request August 6, 2025 06:44 Inactive
@github-actions github-actions bot temporarily deployed to pull request August 6, 2025 06:52 Inactive
@github-actions github-actions bot temporarily deployed to pull request August 6, 2025 07:11 Inactive
@akanshaaa19 akanshaaa19 requested a review from kurund August 6, 2025 09:27
@github-actions github-actions bot temporarily deployed to pull request October 13, 2025 04:58 Inactive
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cfdd620 and cdb2729.

📒 Files selected for processing (4)
  • src/components/floweditor/FlowEditor.helper.tsx (1 hunks)
  • src/components/floweditor/FlowEditor.test.tsx (6 hunks)
  • src/components/floweditor/FlowEditor.tsx (4 hunks)
  • src/mocks/Flow.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/mocks/Flow.tsx
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}

⚙️ CodeRabbit configuration file

Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.

Files:

  • src/components/floweditor/FlowEditor.helper.tsx
  • src/components/floweditor/FlowEditor.test.tsx
  • src/components/floweditor/FlowEditor.tsx
🧬 Code graph analysis (3)
src/components/floweditor/FlowEditor.helper.tsx (2)
src/config/index.ts (1)
  • FLOW_EDITOR_API (30-30)
src/services/AuthService.tsx (1)
  • getAuthSession (26-51)
src/components/floweditor/FlowEditor.test.tsx (1)
src/mocks/Flow.tsx (1)
  • publishFlowWithSuccess (440-455)
src/components/floweditor/FlowEditor.tsx (1)
src/components/floweditor/FlowEditor.helper.tsx (4)
  • deleteFlowDefinition (68-89)
  • fetchLatestRevision (91-114)
  • getFlowDefinition (45-66)
  • postLatestRevision (116-138)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: CI
  • GitHub Check: glific (1.18.3-otp-27, 27.3.3)

Comment on lines +96 to +100
const response = await fetch(`${glificBase}revisions/${uuid}?version=13.2`, {
headers: {
authorization: token,
},
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Include Bearer prefix on Authorization header

The flow-editor API expects standard bearer auth. Here we send the raw token (authorization: token), which the backend treats as missing credentials, returning 401. This regresses publishing after idle periods—the exact bug reported in PR comments. Prefix the header with Bearer (and bail early if token is falsy) so the request reuses our auth session correctly.

-    const response = await fetch(`${glificBase}revisions/${uuid}?version=13.2`, {
-      headers: {
-        authorization: token,
-      },
-    });
+    if (!token) {
+      throw new Error('Missing access token for revision fetch');
+    }
+
+    const response = await fetch(`${glificBase}revisions/${uuid}?version=13.2`, {
+      headers: {
+        authorization: `Bearer ${token}`,
+      },
+    });
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const response = await fetch(`${glificBase}revisions/${uuid}?version=13.2`, {
headers: {
authorization: token,
},
});
if (!token) {
throw new Error('Missing access token for revision fetch');
}
const response = await fetch(`${glificBase}revisions/${uuid}?version=13.2`, {
headers: {
authorization: `Bearer ${token}`,
},
});
🤖 Prompt for AI Agents
In src/components/floweditor/FlowEditor.helper.tsx around lines 96 to 100, the
fetch call sends the raw token in the authorization header which the API expects
as a Bearer token; update the code to early-return or throw if token is falsy,
and set the header to "Authorization": `Bearer ${token}` (i.e., prefix the token
with "Bearer " and use the proper header key casing) so the backend recognizes
the credentials and avoids 401s after idle periods.

Comment on lines +288 to +313
const checkLatestRevision = async () => {
let revisionSaved = false;
if (uuid) {
const latestRevision = await fetchLatestRevision(uuid);
const flowDefinition = await getFlowDefinition(uuid);

if (latestRevision && flowDefinition) {
const latestRevisionTime = dayjs(latestRevision.created_on);
const flowDefinitionTime = dayjs(flowDefinition.timestamp);

if (flowDefinitionTime.isAfter(latestRevisionTime)) {
const timeDifferenceSeconds = flowDefinitionTime.diff(latestRevisionTime, 'seconds');
revisionSaved =
timeDifferenceSeconds > 300 ? await postLatestRevision(uuid, flowDefinition.definition) : true;
} else {
revisionSaved = true;
}
} else if (!flowDefinition) {
setLogs(`Local Flow definition not found ${uuid}`, 'info');

// If flowDefinition is not found, we assume the revision is saved
revisionSaved = true;
}
}
return revisionSaved;
};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Surface failure when revisions can't be synced

When fetchLatestRevision/getFlowDefinition returns null we bail with false, but nothing informs the user why publish didn't proceed; dialog just spins. Add error notification + reset loading.

🤖 Prompt for AI Agents
In src/components/floweditor/FlowEditor.tsx around lines 288-313, when
fetchLatestRevision or getFlowDefinition returns null the function currently
proceeds without surfacing an error and the publish dialog can continue
spinning; update the null/failed branches to log an error (use setLogs with an
error message including the uuid and which call failed) and reset the
publishing/loading state (e.g., call setIsPublishing(false) or the component's
equivalent) before returning false so the UI is notified and the dialog stops.

@akanshaaa19
Copy link
Member Author

putting this on hold because we are already working on floweditor auth here which might be a potential issue for this too

@akanshaaa19 akanshaaa19 added the on hold This is on hold label Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

on hold This is on hold

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Floweditor: Persist unsaved flow changes in localStorage to prevent data loss

5 participants