cli icon indicating copy to clipboard operation
cli copied to clipboard

Show auth config diff after supabase link

Open mezoistvan opened this issue 1 year ago • 1 comments

Bug report

  • [x] I confirm this is a bug with Supabase, not with my own application.
  • [x] I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

After supabase init, if the linked and local config is different, there is a message which lists the differences in the config:

$ supabase link
Selected project: .................................
Enter your database password (or leave blank to skip): 
Finished supabase link.
WARNING: Local config differs from linked project. Try updating supabase/config.toml
[api]
enabled = true
port = 54321
schemas = ["public", "graphql_public"]
extra_search_path = ["public", "extensions"]
max_rows = 1000
[api.tls]
enabled = false

This message does not include all differences. For example if [auth.email] enable_confirmations differs, it's not shown. This is misleading and confusing.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Go to a remote project on supabase.com, enable email auth and disable enable_confirmations
  2. Create a local project and set up config.toml with [email.auth] enable_confirmations enabled.
  3. Link your remote project to your local one and see the difference.

Expected behavior

All diffs should be visible in the message

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: macOS
  • Version of supabase cli: 1.187.3
  • Version of Node.js: 20

Additional context

Is there a way to see when a linked config like this was changed? Is there a way to log these config changes on a linked project?

mezoistvan avatar Jul 23 '24 09:07 mezoistvan

My config is the same, and I'm having this exact same issue. This might be related to issue https://github.com/supabase/cli/issues/1483

From the Supabase discord I'm seeing this might just be a warning?

vick — 07/08/2024 4:12 PM
Every other time I got this message, it was showing me stuff missing from my local config.toml file. I started getting this one too and I cannot for the life of me figure out why because these lines are in my config.toml. I cannot remove them or the API service won't start.
It causes no harm, so just ignore it until they fix it. It is just a notice.

kiarafbickers avatar Jul 24 '24 18:07 kiarafbickers

This is happening again in v1.226.3

No issues, just the warning message after linking and a diff between the local and remote supabase/config.toml.

ThingEngineer avatar Dec 02 '24 18:12 ThingEngineer

As requested by the original ticket, we have released enhancement to diff the entire auth config between local and linked project.

You can update your local config.toml according to the suggested diff to resolve the warnings.

sweatybridge avatar Dec 02 '24 19:12 sweatybridge

Thank you @sweatybridge, since this does not cause an actual problem with anything I don't feel it warrants it's own issue. However, just as an fyi there may be one side effect to consider.

As supabase link needs to be re-run on other occasions such as when a remote service version is a higher version than your local instance or when you change your db password this warning and diff will be shown then as well. And since, for local development environments, site_url and additional_redirect_urls alone will prevent the local config from ever matching the remote config, so the warning message and diff is guaranteed to show on every re-link.

ThingEngineer avatar Dec 03 '24 16:12 ThingEngineer