diff --git a/apps/docs/content/guides/auth/auth-anonymous.mdx b/apps/docs/content/guides/auth/auth-anonymous.mdx
index cf0ee68c4c79b..4ccb77a318177 100644
--- a/apps/docs/content/guides/auth/auth-anonymous.mdx
+++ b/apps/docs/content/guides/auth/auth-anonymous.mdx
@@ -148,10 +148,10 @@ try await supabase.auth.updateUser(
-You can use the [`modifyUser()`](/docs/reference/kotlin/auth-updateuser) method to link an email or phone identity to the anonymous user.
+You can use the [`updateUser()`](/docs/reference/kotlin/auth-updateuser) method to link an email or phone identity to the anonymous user.
```kotlin
-supabase.auth.modifyUser {
+supabase.auth.updateUser {
email = "example@email.com"
}
```
diff --git a/apps/docs/content/guides/auth/debugging/error-codes.mdx b/apps/docs/content/guides/auth/debugging/error-codes.mdx
index 92392b22fc0e7..1116fbd4778fb 100644
--- a/apps/docs/content/guides/auth/debugging/error-codes.mdx
+++ b/apps/docs/content/guides/auth/debugging/error-codes.mdx
@@ -59,16 +59,15 @@ Errors originating from the server API classed as `AuthApiError` always have a `
-All errors originating from the `supabase.auth` namespace of the JavaScript client library will be wrapped by the `AuthError` class.
+All exceptions originating from the `supabase.auth` namespace of the Kotlin client library will be a subclass of `RestException`.
-Error objects are split in a few classes:
+Rest exceptions are split into a few classes:
-- `AuthApiError` -- errors which originate from the Supabase Auth API.
- - Use `isAuthApiError` instead of `instanceof` checks to see if an error you caught is of this type.
-- `CustomAuthError` -- errors which generally originate from state in the client library.
- - Use the `name` property on the error to identify the class of error received.
+- `AuthRestException` -- exceptions which originate from the Supabase Auth API and have a `errorCode` property that can be used to identify the error returned by the server.
+- `AuthWeakPasswordException` -- an `AuthRestException` which indicates that the password is too weak.
+- `AuthSessionMissingException` -- an `AuthRestException` which indicates that the session is missing, if the user was logged out or deleted.
-Errors originating from the server API classed as `AuthApiError` always have a `code` property that can be used to identify the error returned by the server. The `status` property is also present, encoding the HTTP status code received in the response.
+All instances and subclasses of a `AuthRestException` have a `errorCode` property that can be used to identify the error returned by the server.
diff --git a/apps/docs/content/guides/auth/phone-login.mdx b/apps/docs/content/guides/auth/phone-login.mdx
index b42005f47c106..aa006d73d048a 100644
--- a/apps/docs/content/guides/auth/phone-login.mdx
+++ b/apps/docs/content/guides/auth/phone-login.mdx
@@ -215,6 +215,15 @@ try await supabase.auth.updateUser(
)
```
+
+
+
+```kotlin
+supabase.auth.updateUser {
+ phone = "123456789"
+}
+```
+
diff --git a/apps/docs/docs/ref/kotlin/installing.mdx b/apps/docs/docs/ref/kotlin/installing.mdx
index c3eb71b2374a6..93a918c49ffc1 100644
--- a/apps/docs/docs/ref/kotlin/installing.mdx
+++ b/apps/docs/docs/ref/kotlin/installing.mdx
@@ -30,6 +30,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supab
Checkout the different READMEs for information about supported Kotlin targets.
+ *Note that the minimum Android SDK version is 26. For lower versions, you need to enable [core library desugaring](https://developer.android.com/studio/write/java8-support#library-desugaring).*
+
void
}
-const generateJobDetailsSQL = (jobId: number) => {
- return `select * from cron.job_run_details where jobid = '${jobId}' order by start_time desc limit 10`
-}
-
export const CronJobCard = ({ job, onEditCronJob, onDeleteCronJob }: CronJobCardProps) => {
const [toggleConfirmationModalShown, showToggleConfirmationModal] = useState(false)
const { ref } = useParams()
@@ -81,9 +77,7 @@ export const CronJobCard = ({ job, onEditCronJob, onDeleteCronJob }: CronJobCard
Edit cron job
-
+
View previous runs
diff --git a/apps/studio/components/interfaces/Integrations/CronJobs/CronJobs.constants.tsx b/apps/studio/components/interfaces/Integrations/CronJobs/CronJobs.constants.tsx
index ec4039916f021..470a2c97d4a32 100644
--- a/apps/studio/components/interfaces/Integrations/CronJobs/CronJobs.constants.tsx
+++ b/apps/studio/components/interfaces/Integrations/CronJobs/CronJobs.constants.tsx
@@ -18,8 +18,8 @@ export const CRONJOB_DEFINITIONS = [
{
value: 'sql_function',
icon: ,
- label: 'Postgres SQL Function',
- description: 'Choose a Postgres SQL functions to run.',
+ label: 'Database function',
+ description: 'Choose a database function to run.',
},
{
diff --git a/apps/studio/components/interfaces/Integrations/CronJobs/CronJobs.utils.ts b/apps/studio/components/interfaces/Integrations/CronJobs/CronJobs.utils.ts
index af9f02fa5285d..8ad110fa62cfc 100644
--- a/apps/studio/components/interfaces/Integrations/CronJobs/CronJobs.utils.ts
+++ b/apps/studio/components/interfaces/Integrations/CronJobs/CronJobs.utils.ts
@@ -111,7 +111,36 @@ export const parseCronJobCommand = (originalCommand: string): CronJobType => {
return DEFAULT_CRONJOB_COMMAND
}
+export function calculateDuration(start: string, end: string): string {
+ const startTime = new Date(start).getTime()
+ const endTime = new Date(end).getTime()
+ const duration = endTime - startTime
+ return isNaN(duration) ? 'Invalid Date' : `${duration} ms`
+}
+
+export function formatDate(dateString: string): string {
+ const date = new Date(dateString)
+ if (isNaN(date.getTime())) {
+ return 'Invalid Date'
+ }
+ const options: Intl.DateTimeFormatOptions = {
+ year: 'numeric',
+ month: 'short', // Use 'long' for full month name
+ day: '2-digit',
+ hour: '2-digit',
+ minute: '2-digit',
+ second: '2-digit',
+ hour12: false, // Use 12-hour format if preferred
+ timeZoneName: 'short', // Optional: to include timezone
+ }
+ return date.toLocaleString(undefined, options)
+}
+
// detect seconds like "10 seconds" or normal cron syntax like "*/5 * * * *"
export const secondsPattern = /^\d+\s+seconds$/
export const cronPattern =
/^(\*|(\d+|\*\/\d+)|\d+\/\d+|\d+-\d+|\d+(,\d+)*)(\s+(\*|(\d+|\*\/\d+)|\d+\/\d+|\d+-\d+|\d+(,\d+)*)){4}$/
+
+export function isSecondsFormat(schedule: string): boolean {
+ return secondsPattern.test(schedule.trim())
+}
diff --git a/apps/studio/components/interfaces/Integrations/CronJobs/CronJobsEmptyState.tsx b/apps/studio/components/interfaces/Integrations/CronJobs/CronJobsEmptyState.tsx
new file mode 100644
index 0000000000000..9abe797ab7d5e
--- /dev/null
+++ b/apps/studio/components/interfaces/Integrations/CronJobs/CronJobsEmptyState.tsx
@@ -0,0 +1,14 @@
+export default function CronJobsEmptyState({ page }: { page: string }) {
+ return (
+
+
+ {page === 'jobs' ? 'No cron jobs created yet' : 'No runs for this cron job yet'}
+
+
+ {page === 'jobs'
+ ? 'Create one by clicking "Create a new cron job"'
+ : 'Check the schedule of your cron jobs to see when they run'}
+