mirror of
https://github.com/got-feedBack/feedBack.git
synced 2026-09-12 04:58:31 +00:00
fix(career): specific-tuning interstitial guard + 404-revert re-render (Toby F1/F2/F3)
F1 (HIGH): onGigSongLoading used `pref !== 'specific'` but production pref
is always 'specific:<name>' not bare 'specific' — guard was always true,
interstitial fired even when every gig song shared one tuning.
Fix: !pref.startsWith('specific:')
F2 (MEDIUM): JS test for specific-exemption used bare 'specific' (impossible
in production), giving false confidence. Updated to 'specific:E Standard',
which is the real production shape and correctly exercises the fixed guard.
F3 (MEDIUM): On 404-revert (_ppGigTuningPref → 'any'), poster was not
re-rendered so the stale pill from the previous successful booking stayed
highlighted while internal pref was already 'any'.
Fix: re-render overlay with gigPosterHTML(_ppGigProposal) before returning.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H2bM5jSbMskpdxm2CmuQVj
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
2a455702b8
commit
c46b6484bf
@@ -1135,9 +1135,13 @@
|
|||||||
});
|
});
|
||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
const err = await res.json().catch(() => ({}));
|
const err = await res.json().catch(() => ({}));
|
||||||
// Tuning filter yielded no songs → revert to 'any' and notify
|
// Tuning filter yielded no songs → revert to 'any', re-render poster, notify
|
||||||
_ppGigTuningPref = 'any';
|
_ppGigTuningPref = 'any';
|
||||||
lsSet(PP_TUNING_PREF_KEY, 'any');
|
lsSet(PP_TUNING_PREF_KEY, 'any');
|
||||||
|
if (_ppGigProposal) {
|
||||||
|
const overlay = $('pp-overlay');
|
||||||
|
if (overlay) overlay.innerHTML = gigPosterHTML(_ppGigProposal);
|
||||||
|
}
|
||||||
if (window.fbNotify && typeof window.fbNotify.show === 'function') {
|
if (window.fbNotify && typeof window.fbNotify.show === 'function') {
|
||||||
try { window.fbNotify.show({ title: 'Tuning filter', message: (err && err.detail) || 'No songs match that tuning filter.', icon: '🎸' }); } catch (_) { /* */ }
|
try { window.fbNotify.show({ title: 'Tuning filter', message: (err && err.detail) || 'No songs match that tuning filter.', icon: '🎸' }); } catch (_) { /* */ }
|
||||||
}
|
}
|
||||||
@@ -1466,7 +1470,7 @@
|
|||||||
// Interstitial: pause before first song (or when tuning changes) for all
|
// Interstitial: pause before first song (or when tuning changes) for all
|
||||||
// non-specific prefs, so the player has time to retune. "specific" is
|
// non-specific prefs, so the player has time to retune. "specific" is
|
||||||
// excluded because every song already matches one fixed tuning.
|
// excluded because every song already matches one fixed tuning.
|
||||||
const needsInterstitial = pref !== 'specific' && (
|
const needsInterstitial = !pref.startsWith('specific:') && (
|
||||||
run.idx === 0 || tuningName !== _ppGigLastTuning
|
run.idx === 0 || tuningName !== _ppGigLastTuning
|
||||||
);
|
);
|
||||||
_ppGigLastTuning = tuningName;
|
_ppGigLastTuning = tuningName;
|
||||||
|
|||||||
@@ -110,9 +110,11 @@ describe('career-gig-tuning interstitial', () => {
|
|||||||
assert.notEqual(get(ctx, 'window.__careerPassportTest.getTuningHold()'), null);
|
assert.notEqual(get(ctx, 'window.__careerPassportTest.getTuningHold()'), null);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('first song does NOT fire interstitial for pref=specific', () => {
|
test('first song does NOT fire interstitial for pref=specific:E Standard', () => {
|
||||||
|
// Failure input: bare 'specific' would pass the old wrong guard `!== 'specific'`
|
||||||
|
// but is impossible in production. Real value is always 'specific:<name>'.
|
||||||
const ctx = makeCtx();
|
const ctx = makeCtx();
|
||||||
setRun(ctx, 'specific', [{ filename: 'a.sloppak', tuning_name: 'E Standard' }]);
|
setRun(ctx, 'specific:E Standard', [{ filename: 'a.sloppak', tuning_name: 'E Standard' }]);
|
||||||
callOnLoading(ctx);
|
callOnLoading(ctx);
|
||||||
assert.equal(get(ctx, 'window.__careerPassportTest.getTuningHold()'), null);
|
assert.equal(get(ctx, 'window.__careerPassportTest.getTuningHold()'), null);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user