You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
12f7629 removed the ability to keep using the old format when serializing via SignedGlobalID. This causes the following issues:
Temporary errors during rolling deployments: During a rolling deployment, is possible to sign new data using the new format (new codebase) and then trigger an error when decoding the new data via the old codebase.
Rollbacks: When the data is encoded with the new format, it needs to be re-encoded to be read using the old format; this complicates rolling back to an old version.
I understand that "Rollbacks" can be considered a "no-issue" since the upgrade is one-way but I'm still afraid of the rolling-deployment issue. Additionally, Version "1.2.1" is the new version pointed by Rails "7.1", which makes rolling back a Rails upgrade more complicated because it forces you to upgrade GlobalID before upgrading Rails in order to not encounter the "unexpected" rollback issue.
#!/usr/bin/env rubyrequire"bundler/inline"globalid_version=ARGV[0]
$sgid =ARGV[1]# true = install gems so this is fast on repeat invocationsgemfile(true,quiet: true)dosource"https://rubygems.org"gem"globalid",globalid_versiongem"activerecord","~> 7.1"gem"sqlite3"endrequire"active_record"# This connection will do for database-independent bug reports.ActiveRecord::Base.establish_connection(adapter: "sqlite3",database: ":memory:")ActiveRecord::Schema.definedocreate_table"people"do |t|
t.string"name"endendclassPerson < ActiveRecord::Base;endSignedGlobalID.verifier=ActiveSupport::MessageVerifier.new("secret")person=Person.create!(name: "John Doe")if $sgid
require"minitest/autorun"classSignedGlobalIdTest < Minitest::Testdeftest_cant_locate_new_format_sgid_with_old_versionassertGlobalID::Locator.locate_signed($sgid),"Can't locate by SGID"endendelseputsSignedGlobalID.create(person,app: "test")end
The text was updated successfully, but these errors were encountered:
intrip
changed the title
SignedGlobalID: Consider re-adding the ability to use the old serialization format
SignedGlobalID: Consider re-adding the ability to use the old serialization format and make new format opt-in
Nov 9, 2023
intrip
changed the title
SignedGlobalID: Consider re-adding the ability to use the old serialization format and make new format opt-in
SignedGlobalID: Consider re-adding the ability to use the old serialization format
Nov 9, 2023
12f7629 removed the ability to keep using the old format when serializing via
SignedGlobalID
. This causes the following issues:I understand that "Rollbacks" can be considered a "no-issue" since the upgrade is one-way but I'm still afraid of the rolling-deployment issue. Additionally, Version "1.2.1" is the new version pointed by Rails "7.1", which makes rolling back a Rails upgrade more complicated because it forces you to upgrade GlobalID before upgrading Rails in order to not encounter the "unexpected" rollback issue.
The text was updated successfully, but these errors were encountered: