) : (
<>
@@ -126,10 +126,7 @@ const StorageMenu = () => {
{
- console.log('onClose')
- setShowCreateBucketModal(false)
- }}
+ onClose={() => setShowCreateBucketModal(false)}
/>
diff --git a/studio/tests/components/ProjectDropdown.test.ts b/studio/tests/components/ProjectDropdown.test.ts
new file mode 100644
index 00000000000..36142b2e1e7
--- /dev/null
+++ b/studio/tests/components/ProjectDropdown.test.ts
@@ -0,0 +1,22 @@
+import { sanitizeRoute } from 'components/layouts/ProjectLayout/LayoutHeader/ProjectDropdown'
+
+test('Should sanitize project routes correctly when switching projects by removing project specific parameters', () => {
+ expect(sanitizeRoute('/project/[ref]', { ref: 'abc' })).toBe('/project/[ref]')
+ expect(sanitizeRoute('/project/[ref]/editor', { ref: 'abc' })).toBe('/project/[ref]/editor')
+ expect(sanitizeRoute('/project/[ref]/storage/buckets', { ref: 'abc' })).toBe(
+ '/project/[ref]/storage/buckets'
+ )
+ expect(sanitizeRoute('/project/[ref]/settings/billing/subscription', { ref: 'abc' })).toBe(
+ '/project/[ref]/settings/billing/subscription'
+ )
+
+ expect(sanitizeRoute('/project/[ref]/editor/[tableId]', { ref: 'abc', tableId: '10' })).toBe(
+ '/project/[ref]/editor'
+ )
+ expect(
+ sanitizeRoute('/project/[ref]/storage/buckets/[bucketId]', { ref: 'abc', bucketId: 'bucket-1' })
+ ).toBe('/project/[ref]/storage/buckets')
+ expect(sanitizeRoute('/project/[ref]/logs/explorer?q=select', { ref: 'abc' })).toBe(
+ '/project/[ref]/logs/explorer?q=select'
+ )
+})
From 0ae4a50f38b0b778415e5b07b3ae2ddefd2fbd79 Mon Sep 17 00:00:00 2001
From: Long Hoang <1732217+loong@users.noreply.github.com>
Date: Tue, 20 Jun 2023 18:38:33 +0800
Subject: [PATCH 021/108] Add swap info to memory exhaust
---
apps/docs/pages/guides/platform/exhaust-ram.mdx | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/apps/docs/pages/guides/platform/exhaust-ram.mdx b/apps/docs/pages/guides/platform/exhaust-ram.mdx
index 1c1649351d2..f8af80d83ce 100644
--- a/apps/docs/pages/guides/platform/exhaust-ram.mdx
+++ b/apps/docs/pages/guides/platform/exhaust-ram.mdx
@@ -23,6 +23,8 @@ You may observe elevated memory usage even when your database has little to no l
Every Supabase project runs in its own dedicated virtual machine. Your instance will have a different set of hardware provisioned depending on your [compute add-on](https://supabase.com/docs/guides/platform/compute-add-ons). Depending on your workload, your compute hardware may not be suitable and can result in high RAM usage.
+A good proxy for unhealthy memory usage is swap usage. If you run out of RAM, your system will offload memory to your disk's much slower swap partition. If your swap is above 40%, chances are high that your compute hardware is not suitable for your workload. Head over to your project's [Database Health](https://supabase.com/dashboard/project/_/reports/database) to see your swap usage.
+
High RAM usage could come with a range of issues:
- degraded performance overall when your instance has to use swap memory
@@ -31,7 +33,7 @@ High RAM usage could come with a range of issues:
## Monitor your RAM
-To check your RAM usage on the Supabase Platform, head over to [Database health in the Reports section](https://app.supabase.com/project/_/reports/database).
+To check your RAM usage on the Supabase Platform, head over to [Database Health in the Reports section](https://supabase.com/dashboard/project/_/reports/database).
It is also possible to monitor your resources and set up alerts using Prometheus/Grafana. With Grafana you will be able to see how much of your RAM is used for caching and you can track other metrics such as your Swap usage. Read the [Metrics Guide](https://supabase.com/docs/guides/platform/metrics) to learn more.
@@ -41,11 +43,11 @@ Everything you do with your Supabase project requires memory in some form. Hence
- **Query performance:** Queries that take a long time to complete (>1 second) could be using your RAM inefficiently. Check our guide on [examining query performance](https://supabase.com/docs/guides/platform/performance#examining-query-performance).
- **Too many connections:** Every connection to your database consumes memory. You can check the number of active connections under [Database Roles](https://supabase.com/dashboard/project/_/database/roles) after you select your project. Read our guide on [too many open connections](https://supabase.com/docs/guides/platform/troubleshooting#too-many-open-connections).
-- **Extensions:** Some extensions such as `timescaledb` or `pg_cron` can use a lot of memory. It can also add up when you have too many extensions running. You can manage your database extensions in the dashboard under [Extensions](https://app.supabase.com/project/_/database/extensions).
+- **Extensions:** Some extensions such as `timescaledb` or `pg_cron` can use a lot of memory. It can also add up when you have too many extensions running. You can manage your database extensions in the dashboard under [Extensions](https://supabase.com/dashboard/project/_/database/extensions).
## How to fix your memory issues
-1. **Upgrade your compute:** You can get a Compute Add-on for your project. See your [upgrade options](https://app.supabase.com/project/_/settings/billing/subscription?panel=computeInstance) by selecting your project.
+1. **Upgrade your compute:** You can get a Compute Add-on for your project. See your [upgrade options](https://supabase.com/dashboard/project/_/settings/billing/subscription?panel=computeInstance) by selecting your project.
2. **Optimize performance:** Get more out of your instance's resources by optimizing your usage. Have a look at our [performance tuning guide](https://supabase.com/docs/guides/platform/performance#examining-query-performance) and our [production readiness guide](https://supabase.com/docs/guides/platform/going-into-prod#performance).
export const Page = ({ children }) =>
From 2c10d3df283fdcf6adbdc8a2b1a630d7a6584ece Mon Sep 17 00:00:00 2001
From: Stojan Dimitrovski
Date: Tue, 20 Jun 2023 14:16:04 +0200
Subject: [PATCH 022/108] feat: bump gotrue-js to v2.31.0
---
package-lock.json | 8 ++++----
packages/common/package.json | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 4fdc32b163d..2291fa1b4f8 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -42805,7 +42805,7 @@
"license": "MIT",
"dependencies": {
"@headlessui/react": "^1.7.14",
- "@supabase/gotrue-js": "2.24.0",
+ "@supabase/gotrue-js": "^2.31.0",
"@supabase/ui": "^0.37.0-alpha.50",
"react-use": "^17.4.0"
},
@@ -42818,9 +42818,9 @@
}
},
"packages/common/node_modules/@supabase/gotrue-js": {
- "version": "2.24.0",
- "resolved": "https://registry.npmjs.org/@supabase/gotrue-js/-/gotrue-js-2.24.0.tgz",
- "integrity": "sha512-ZsH4K5cbMTjfMytXaDYVYs9l9igmlZFxiwXn7J2IP/CklWR5qmLCma+dvat5rccPLITVkN6oAZbKxDzW+pEgCg==",
+ "version": "2.31.0",
+ "resolved": "https://registry.npmjs.org/@supabase/gotrue-js/-/gotrue-js-2.31.0.tgz",
+ "integrity": "sha512-YcwlbbNfedlue/HVIXtYBb4fuOrs29gNOTl6AmyxPp4zryRxzFvslVN9kmLDBRUAVU9fnPJh2bgOR3chRjJX5w==",
"dependencies": {
"cross-fetch": "^3.1.5"
}
diff --git a/packages/common/package.json b/packages/common/package.json
index 5a6f59a186c..eba24a4faeb 100644
--- a/packages/common/package.json
+++ b/packages/common/package.json
@@ -6,7 +6,7 @@
"license": "MIT",
"dependencies": {
"@headlessui/react": "^1.7.14",
- "@supabase/gotrue-js": "2.24.0",
+ "@supabase/gotrue-js": "^2.31.0",
"@supabase/ui": "^0.37.0-alpha.50",
"react-use": "^17.4.0"
},
From 9f9612d7626747e9fda12d2b4a17375c81e01a50 Mon Sep 17 00:00:00 2001
From: Jonathan Summers-Muir
Date: Tue, 20 Jun 2023 20:53:06 +0800
Subject: [PATCH 023/108] fix text button. it had a border.
---
packages/ui/src/components/Button/Button.tsx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/packages/ui/src/components/Button/Button.tsx b/packages/ui/src/components/Button/Button.tsx
index b553b769c86..efb20c93b81 100644
--- a/packages/ui/src/components/Button/Button.tsx
+++ b/packages/ui/src/components/Button/Button.tsx
@@ -85,7 +85,8 @@ const buttonVariants = cva(
text-scale-1200
hover:bg-scale-500
shadow-none
- focus-visible:outline-scale-700`,
+ focus-visible:outline-scale-700
+ border-transparent`,
danger: `
text-red-1100
bg-red-200
From 5a1194aa918a989b613adb8ad224f59ca223d9c1 Mon Sep 17 00:00:00 2001
From: Joshen Lim
Date: Tue, 20 Jun 2023 20:54:37 +0800
Subject: [PATCH 024/108] Fix spelling
---
studio/components/to-be-cleaned/Storage/DeleteBucketModal.tsx | 2 +-
.../{bucket-delete-mutationl.ts => bucket-delete-mutation.ts} | 0
2 files changed, 1 insertion(+), 1 deletion(-)
rename studio/data/storage/{bucket-delete-mutationl.ts => bucket-delete-mutation.ts} (100%)
diff --git a/studio/components/to-be-cleaned/Storage/DeleteBucketModal.tsx b/studio/components/to-be-cleaned/Storage/DeleteBucketModal.tsx
index 312a88a9df1..bf17b863bbd 100644
--- a/studio/components/to-be-cleaned/Storage/DeleteBucketModal.tsx
+++ b/studio/components/to-be-cleaned/Storage/DeleteBucketModal.tsx
@@ -4,7 +4,7 @@ import { useEffect, useState } from 'react'
import { useParams } from 'common'
import TextConfirmModal from 'components/ui/Modals/TextConfirmModal'
-import { useBucketDeleteMutation } from 'data/storage/bucket-delete-mutationl'
+import { useBucketDeleteMutation } from 'data/storage/bucket-delete-mutation'
import { Bucket, useBucketsQuery } from 'data/storage/buckets-query'
import { useStore } from 'hooks'
import { formatPoliciesForStorage } from './Storage.utils'
diff --git a/studio/data/storage/bucket-delete-mutationl.ts b/studio/data/storage/bucket-delete-mutation.ts
similarity index 100%
rename from studio/data/storage/bucket-delete-mutationl.ts
rename to studio/data/storage/bucket-delete-mutation.ts
From a290eff1bbbc188bf2d4c3cdb398b0dfde48277f Mon Sep 17 00:00:00 2001
From: Joshen Lim
Date: Tue, 20 Jun 2023 21:01:40 +0800
Subject: [PATCH 025/108] Remove refetchType all from bucket queries
---
studio/data/storage/bucket-create-mutation.ts | 2 +-
studio/data/storage/bucket-delete-mutation.ts | 2 +-
studio/data/storage/bucket-update-mutation.ts | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/studio/data/storage/bucket-create-mutation.ts b/studio/data/storage/bucket-create-mutation.ts
index 593e8ad4833..3a70d4b0d73 100644
--- a/studio/data/storage/bucket-create-mutation.ts
+++ b/studio/data/storage/bucket-create-mutation.ts
@@ -47,7 +47,7 @@ export const useBucketCreateMutation = ({
{
async onSuccess(data, variables, context) {
const { projectRef } = variables
- await queryClient.invalidateQueries(storageKeys.buckets(projectRef), { refetchType: 'all' })
+ await queryClient.invalidateQueries(storageKeys.buckets(projectRef))
await onSuccess?.(data, variables, context)
},
...options,
diff --git a/studio/data/storage/bucket-delete-mutation.ts b/studio/data/storage/bucket-delete-mutation.ts
index 1f6e053341c..f7b6fa701d0 100644
--- a/studio/data/storage/bucket-delete-mutation.ts
+++ b/studio/data/storage/bucket-delete-mutation.ts
@@ -36,7 +36,7 @@ export const useBucketDeleteMutation = ({
{
async onSuccess(data, variables, context) {
const { projectRef } = variables
- await queryClient.invalidateQueries(storageKeys.buckets(projectRef), { refetchType: 'all' })
+ await queryClient.invalidateQueries(storageKeys.buckets(projectRef))
await onSuccess?.(data, variables, context)
},
...options,
diff --git a/studio/data/storage/bucket-update-mutation.ts b/studio/data/storage/bucket-update-mutation.ts
index 40a748e3c7e..7c14acac315 100644
--- a/studio/data/storage/bucket-update-mutation.ts
+++ b/studio/data/storage/bucket-update-mutation.ts
@@ -46,7 +46,7 @@ export const useBucketUpdateMutation = ({
{
async onSuccess(data, variables, context) {
const { projectRef } = variables
- await queryClient.invalidateQueries(storageKeys.buckets(projectRef), { refetchType: 'all' })
+ await queryClient.invalidateQueries(storageKeys.buckets(projectRef))
await onSuccess?.(data, variables, context)
},
...options,
From cd6d6d2b594a4c1607943495495f55ea2845d79a Mon Sep 17 00:00:00 2001
From: Joshen Lim
Date: Tue, 20 Jun 2023 21:13:28 +0800
Subject: [PATCH 026/108] Fix small styling issue in help popver
---
.../layouts/ProjectLayout/LayoutHeader/HelpPopover.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/studio/components/layouts/ProjectLayout/LayoutHeader/HelpPopover.tsx b/studio/components/layouts/ProjectLayout/LayoutHeader/HelpPopover.tsx
index 6189ebb211e..6b6add879bd 100644
--- a/studio/components/layouts/ProjectLayout/LayoutHeader/HelpPopover.tsx
+++ b/studio/components/layouts/ProjectLayout/LayoutHeader/HelpPopover.tsx
@@ -28,7 +28,7 @@ const HelpPopover: FC = () => {
side="bottom"
sideOffset={8}
overlay={
-
+ Database changes are managed through "migrations" and they are a common way of tracking
+ changes to your database over time. You can run migrations against your project's
+ database via the Supabase CLI.
+