studio-engine 0.72.3 → 0.73.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 13abdd4ef0f10262a6560c40b2bed302c16d9f3b3b21582f3569cf0a7517cdf8
4
- data.tar.gz: 6f47a52a0ba75d8be96ff6200b75d30a1ff49d76db401581a17a0ea88b2dcd6c
3
+ metadata.gz: 60486d6f2711eb8d61d258fa6305f05cfd2d85910858aacc1506dee587f3c114
4
+ data.tar.gz: beb3d3a69e3c01fca35a1196e37065b56b9b563696e2d7d3c6d15d5718440fd1
5
5
  SHA512:
6
- metadata.gz: 4b82e9d95ec946a5ce8fdc2d82269eadd8e300bfe21e146163aa0105a3a96254065ac10b26dd6f87a29cff5a402de1ca6d9cb0cdb53ef7119604ee0102b841d5
7
- data.tar.gz: f03181c1586eb6c147b50778614df087115b27d1e76eb0dee7236f6e73c68a4509dadde3448d04cb84ea16cad4d20ffbe9eef8fcb7e96eca4be34dbd4c080d52
6
+ metadata.gz: c668f68df4d51e460a58a3bfb6b8608acb943b9ab75558b7676c9ed79489219e686249e45c20593ec97c70401ed34c9b8ce78fafb927201912c1d0e87012fd1e
7
+ data.tar.gz: f9f13b69c48bd71d7ad127e1229245a7079dd0155dcfd731fe3044b25fcd439217e6dd61ca3f33b4c73b065cd8d5629dacd500218ac1b27cd02270f528f78e3a
@@ -137,6 +137,68 @@
137
137
  dbg(' ' + key, truncate(val, 40));
138
138
  });
139
139
 
140
+ // === THE REDIRECT TRANSPORT'S RETURN LEG ==============================
141
+ //
142
+ // TRIED FIRST, AND EVERYTHING BELOW IS LEFT EXACTLY AS IT WAS. The legacy
143
+ // block that follows handles ONE step — Phantom's signIn — with keys named
144
+ // phantom_dl_*, and it is what production mobile sign-in runs on TODAY. It is
145
+ // not touched, moved, or reworded here: a consumer that has not yet adopted
146
+ // the new transport must behave identically after this change, and the only
147
+ // honest way to promise that is to leave its code alone.
148
+ //
149
+ // GUARDED THE WAY THIS CODEBASE GUARDS EVERY OPTIONAL CAPABILITY: a host that
150
+ // does not load solana_studio/wallet_ops.js + wallet_journal.js has no
151
+ // SolanaStudio.walletOps, so this branch never runs and the legacy path is
152
+ // the whole program. An absent capability must not default to the permissive
153
+ // branch — the same rule the wallet picker's canDeepLink learned.
154
+ //
155
+ // WHY THE PENDING-JOURNAL CHECK IS PART OF THE GUARD, not just the globals:
156
+ // a host may load the new scripts while a signIn started under the OLD keys
157
+ // is still in flight — a user mid-round-trip across a deploy. Requiring an
158
+ // actual wallet_dl journal means that user finishes on the path they started,
159
+ // rather than being handed to a resumer with nothing to resume.
160
+ //
161
+ // WHAT THIS BRANCH DOES NOT DO: decrypt, verify, or know what the user was
162
+ // trying to accomplish. walletOps owns the step machine and the registered
163
+ // intent owns the outcome. This is a seam, and keeping it a seam is what lets
164
+ // the same callback serve sign-in and a contest entry without learning either.
165
+ var studio = window.SolanaStudio;
166
+ var hasResumer = !!(studio && studio.walletOps && typeof studio.walletOps.resume === 'function' &&
167
+ studio.walletJournal && typeof studio.walletJournal.peek === 'function');
168
+
169
+ if (hasResumer && studio.walletJournal.peek()) {
170
+ dbg('Transport', 'wallet_dl journal present — resuming through walletOps');
171
+
172
+ studio.walletOps.resume(params, {
173
+ navigate: function(url) { window.location.href = url; }
174
+ }).then(function(result) {
175
+ // SUSPENDED means resume already navigated to the next hop; this document
176
+ // is on its way out and must not also redirect, or the two race.
177
+ if (result && result.suspended) {
178
+ dbg('Transport', 'advanced to the next hop');
179
+ return;
180
+ }
181
+ if (result && result.done) {
182
+ dbg('Transport', 'intent complete');
183
+ // The registered intent owns where to land — it knows what the user was
184
+ // doing. Falling back to '/' rather than guessing a wallet-specific
185
+ // destination, which this file has no business knowing.
186
+ window.location.href = (result.value && result.value.redirect) || '/';
187
+ return;
188
+ }
189
+ // No pending request is a STATE, not a failure: a stale bookmark, a second
190
+ // tab, a reload after the journal was consumed. peek() said otherwise a
191
+ // moment ago, so this is a race, and the honest answer is to start over.
192
+ showError('No pending wallet request. Redirecting to login...');
193
+ }, function(err) {
194
+ // A user rejection arrives here with .rejected set — the wallet's own
195
+ // words, already mapped. Anything else is a genuine fault.
196
+ dbg('Transport ERROR', (err && err.message) || String(err));
197
+ showError((err && err.message) || 'Wallet request failed');
198
+ });
199
+ return;
200
+ }
201
+
140
202
  // Check for Phantom error
141
203
  if (params.get('errorCode')) {
142
204
  dbg('ERROR', 'errorCode=' + params.get('errorCode'));
@@ -1,3 +1,3 @@
1
1
  module Studio
2
- VERSION = "0.72.3"
2
+ VERSION = "0.73.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: studio-engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.72.3
4
+ version: 0.73.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex McRitchie