Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Session schema truncates long list of scopes. #514

Open
jhardin-accumula opened this issue Aug 9, 2024 · 0 comments
Open

BUG: Session schema truncates long list of scopes. #514

jhardin-accumula opened this issue Aug 9, 2024 · 0 comments

Comments

@jhardin-accumula
Copy link

Issue summary

Getting this error:

Failed to save session to database: SQLSTATE[22001]: String data, right truncated: 7 ERROR: value too long for type character varying(255)

The list of scopes being saved is:

read_locations,read_price_rules,read_product_listings,write_assigned_fulfillment_orders,write_customers,write_draft_orders,write_fulfillments,write_inventory,write_merchant_managed_fulfillment_orders,write_order_edits,write_orders,write_products,write_returns,write_third_party_fulfillment_orders

...which is 296 characters.

Adding this migration to fix, appears to work:

        Schema::table('sessions', function (Blueprint $table) {
            $table->text('scope')->nullable()->change();  // Don't impose a length limit
        });

Expected behavior

Session should save the scope list however long it is.

Actual behavior

Failed to save session to database: SQLSTATE[22001]: String data, right truncated: 7 ERROR: value too long for type character varying(255)

Steps to reproduce the problem

  1. Put a long list of scopes (> 255 chars) in your TOML and deploy
  2. Attempt to use the app
  3. Get 500 error, SQL truncation error in log

NOTE: This issue probably applies to other app templates as well. They should be reviewed.

@jhardin-accumula jhardin-accumula changed the title Session schema truncates long list of scopes. BUG: Session schema truncates long list of scopes. Aug 9, 2024
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

No branches or pull requests

1 participant