Skip to content

feat(web): add Company Brain automation settings#1316

Open
sreedharsreeram wants to merge 2 commits into
mainfrom
sreedharsreeram/raleigh
Open

feat(web): add Company Brain automation settings#1316
sreedharsreeram wants to merge 2 commits into
mainfrom
sreedharsreeram/raleigh

Conversation

@sreedharsreeram

Copy link
Copy Markdown
Member

Add recurring automation templates, creation and editing, Slack destination and default-channel controls, DST-aware GMT-labelled timezone selection, ownership and Slack-origin labels, and explicit loading and error states.

Add recurring automation templates, creation and editing, Slack destination and default-channel controls, DST-aware GMT-labelled timezone selection, ownership and Slack-origin labels, and explicit loading and error states.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 20, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
supermemory-app f20c541 Commit Preview URL

Branch Preview URL
Jul 20 2026, 08:14 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 20, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
supermemory-mcp f20c541 Jul 20 2026, 08:13 PM

Copy link
Copy Markdown
Member Author

How to use the Graphite Merge Queue

Add the label Main to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@sreedharsreeram
sreedharsreeram marked this pull request as ready for review July 20, 2026 17:22
@claude

claude Bot commented Jul 20, 2026

Copy link
Copy Markdown

Claude finished @MaheshtheDev's task in 1m 58s —— View job


Reviewing PR #1316

  • Fetch PR diff and review comments
  • Analyze changed files for bugs and security issues
  • Check surrounding code context
  • Submit review findings

Review complete. No critical issues found. The code is well-structured with:

  • Domain logic cleanly extracted to domain.ts
  • Thorough input validation in cron parsing functions
  • Proper https:// validation for sourceThreadUrl (prevents protocol injection)
  • Consistent error handling with retry functionality

The Graphite comment about timezone validation is a reasonable defensive improvement but not a blocker — invalid timezones would only occur from corrupted backend data since the dropdown only shows valid IANA zones.

Score: 10/10 — Good to ship.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Overview: Adds recurring automation templates, default channel settings, DST-aware timezone selection, and loading/error states for the Company Brain automations UI.

Issues found: None — this looks good to ship.

The code is well-structured:

  • Domain logic is cleanly extracted to domain.ts with proper type definitions and pure utility functions
  • Input validation is thorough (cron parsing, timezone validation, URL protocol checks)
  • Error handling is consistent across all API calls with proper user feedback
  • The sourceThreadUrl link correctly validates for https:// before rendering, preventing protocol injection
  • Loading and error states are explicit with retry functionality
  • The "advanced cron" preservation logic correctly handles Slack-created schedules that fall outside the simple web editor

Score: 10/10

Comment on lines +283 to 286
draft.rawCron ?? toLocalCron(draft.time, draft.frequency, draft.weekday)
if (!cron) throw new Error("Pick a valid time.")
if (!draft.timezone.trim()) throw new Error("Enter an IANA timezone.")
return {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing timezone validation before sending to backend. While the timezone field is checked for non-empty string, there's no validation that it's a valid IANA timezone identifier. If an invalid timezone somehow ends up in draft state (from corrupted data, old automations, or edge cases in the memoization logic at lines 252-262), it will be sent to the backend and could cause server-side failures.

// Add validation:
if (!draft.timezone.trim()) throw new Error("Enter an IANA timezone.")
try {
  // Validate timezone is supported
  new Intl.DateTimeFormat('en-US', { timeZone: draft.timezone }).format(new Date())
} catch {
  throw new Error("Enter a valid IANA timezone.")
}

This validation should occur before the body is constructed to prevent invalid timezones from reaching the API.

Suggested change
draft.rawCron ?? toLocalCron(draft.time, draft.frequency, draft.weekday)
if (!cron) throw new Error("Pick a valid time.")
if (!draft.timezone.trim()) throw new Error("Enter an IANA timezone.")
return {
draft.rawCron ?? toLocalCron(draft.time, draft.frequency, draft.weekday)
if (!cron) throw new Error("Pick a valid time.")
if (!draft.timezone.trim()) throw new Error("Enter an IANA timezone.")
try {
new Intl.DateTimeFormat('en-US', { timeZone: draft.timezone }).format(new Date())
} catch {
throw new Error("Enter a valid IANA timezone.")
}
return {

Spotted by Graphite

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@polylane

polylane Bot commented Jul 20, 2026

Copy link
Copy Markdown

Note

Production impact unlikely.

Reviewed the incremental layout commit (f20c541): purely CSS/JSX restructuring with no API, mutation, or binding changes. supermemory-app shows 0 errors at ~13 req/s.


view-investigation review-in-polylane disable-pr-reviews

Polylane analysed f20c541 for production impact.

Drop the default-channel card and fold the picker into the "Your
automations" header row as a borderless text control, so the section
starts with content instead of a set-once org setting.

Move Timezone into the Frequency/Time row and put its GMT/DST helper
behind the same Info tooltip pattern used by "Deliver to". Row wraps so
the weekly "Day" field doesn't crush it.

Also render channel names as #name rather than "# name".

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Overview: Adds recurring automation templates, default channel settings, DST-aware timezone selection, and loading/error states for the Company Brain automations UI.

Issues found: None critical. The Graphite comment about timezone validation is a reasonable defensive improvement — adding Intl.DateTimeFormat validation would catch edge cases where corrupted backend data contains an invalid IANA identifier. However, this is low-risk since:

  • The dropdown only shows valid timezones from Intl.supportedValuesOf("timeZone")
  • New automations use the browser's timezone (always valid)
  • Invalid data would need to originate from the backend

The code is well-structured:

  • Domain logic cleanly extracted to domain.ts with proper type definitions
  • toLocalCron / fromLocalCron have thorough input validation (hours 0-23, minutes 0-59, weekdays 0-6)
  • sourceThreadUrl correctly validates for https:// prefix before rendering, preventing protocol injection
  • Error handling is consistent with user-friendly messages and retry functionality
  • The "advanced cron" preservation correctly handles Slack-created schedules outside the simple web editor

Score: 10/10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants