Sessione salvata: copia alla chiusura della finestra e alla fine della guida, «Serve «Ho finito»», scelta per la copia incompleta e stato in Collegamento (#36, S4b)
Risposte 1, 5, 6, 9 e 10 di Alberto a S4. I valori __spin_r, __spin_b e __spin_t si copiano dalla pagina come gli altri (su Instagram da SiteData, ipotesi H23, operazioni ancora non configurate; nel sito di prova dal modulo GiroProva). La sessione si copia anche quando si chiude la finestra del browser su Windows e quando il permesso di guida finisce, sempre prima che la pagina torni al motore e con le garanzie di «Ho finito». Con «richieste» «Collegato» vuole una sessione salvata leggibile, altrimenti lo stato è «Serve «Ho finito»» e il motore aspetta. Nuova impostazione sessione.copia-incompleta (sostituisci, predefinita, o tieni-completa) e riquadro della sessione salvata nella pagina Collegamento, con soli conteggi e nomi. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9958745e53
commit
883ea4683c
41 files changed
+1349
-101
No files matched your search
@@ -65,7 +65,8 @@ public sealed class HttpSiteRequesterShapeTests
|
||||
Assert.AreEqual(TestSite.ProfileQuery, request.Header("x-fb-friendly-name"));
|
||||
Assert.AreEqual("0", request.Header("x-ig-www-claim"));
|
||||
Assert.AreEqual(
|
||||
"av=17841400000000077&__a=1&__ccg=BUONA&__comet_req=7&__hs=hs-di-prova&__hsi=hsi-di-prova&__rev=revisione-di-prova&dpr=1"
|
||||
"av=17841400000000077&__a=1&__ccg=BUONA&__comet_req=7&__hs=hs-di-prova&__hsi=hsi-di-prova&__rev=revisione-di-prova"
|
||||
+ "&__spin_r=1001&__spin_b=ramo-di-prova&__spin_t=1700000000&dpr=1"
|
||||
+ "&fb_dtsg=dtsg-di-prova&lsd=lsd-di-prova&fb_api_req_friendly_name=ProvaProfiloQuery"
|
||||
+ "&variables=%7B%22username%22%3A%22marta.prova%22%2C%22scheda%22%3A%22post%22%2C%22primi%22%3A12%2C%22raccolte%22%3Atrue%7D"
|
||||
+ "&doc_id=8000000000000001",
|
||||
@@ -360,6 +361,9 @@ public sealed class HttpSiteRequesterShapeTests
|
||||
[DataRow("ccg", "__ccg")]
|
||||
[DataRow("comet_req", "__comet_req")]
|
||||
[DataRow("entry_nonce", "x-fb-entry-nonce")]
|
||||
[DataRow("spin_r", "__spin_r")]
|
||||
[DataRow("spin_b", "__spin_b")]
|
||||
[DataRow("spin_t", "__spin_t")]
|
||||
public async Task AVersionFieldTheSessionLacksStopsTheQueryBeforeItLeaves(string field, string missing)
|
||||
{
|
||||
using var listener = new OneShotListener("""{"profilo":{}}""");
|
||||
|
||||
@@ -452,7 +452,7 @@ public sealed class HttpSiteRequesterTests
|
||||
var secrets = new List<string>
|
||||
{
|
||||
Csrf, OtherCookie, SiteControl.InitialSession, "rinnovata-1", "claim-prova-1", TestSite.AppId, TestSite.Lsd, TestSite.Dtsg, AccountId,
|
||||
TestSite.Revision, TestSite.HasteSession, TestSite.HasteSessionId, TestSite.ConnectionClass, TestSite.EntryNonce,
|
||||
TestSite.Revision, TestSite.HasteSession, TestSite.HasteSessionId, TestSite.ConnectionClass, TestSite.EntryNonce, TestSite.SpinBranch,
|
||||
TestSite.DocIds[TestSite.ProfileQuery], UserAgent, "Mozilla", "marta.prova", "luca.prova", "c12", "127.0.0.1", "scheda", "primi", "accesso", "next",
|
||||
};
|
||||
secrets.AddRange(cases.Values.SelectMany(c => c.Values.Values));
|
||||
@@ -574,6 +574,9 @@ public sealed class HttpSiteRequesterTests
|
||||
["comet_req"] = TestSite.CometReq,
|
||||
["ccg"] = TestSite.ConnectionClass,
|
||||
["entry_nonce"] = TestSite.EntryNonce,
|
||||
["spin_r"] = TestSite.SpinRevision,
|
||||
["spin_b"] = TestSite.SpinBranch,
|
||||
["spin_t"] = TestSite.SpinTime,
|
||||
};
|
||||
|
||||
/// <summary>A site client for the test site with its session, clock and log.</summary>
|
||||
|
||||
@@ -345,6 +345,9 @@ public sealed partial class RequestCatalogTests
|
||||
Assert.AreEqual(new PageValueSource("SiteData", "comet_env"), instagram.Values["comet_req"]);
|
||||
Assert.AreEqual(new PageValueSource("WebConnectionClassServerGuess", "connectionClass"), instagram.Values["ccg"]);
|
||||
Assert.AreEqual(new PageValueSource("BootloaderConfig", "nonce"), instagram.Values["entry_nonce"]);
|
||||
Assert.AreEqual(new PageValueSource("SiteData", "__spin_r"), instagram.Values["spin_r"]);
|
||||
Assert.AreEqual(new PageValueSource("SiteData", "__spin_b"), instagram.Values["spin_b"]);
|
||||
Assert.AreEqual(new PageValueSource("SiteData", "__spin_t"), instagram.Values["spin_t"]);
|
||||
CollectionAssert.AreEquivalent(SiteSessionValues.PageFields.ToArray(), instagram.Values.Keys.ToArray(), "A place for every page value.");
|
||||
|
||||
// The test site has its own module names, never Instagram's.
|
||||
@@ -376,9 +379,10 @@ public sealed partial class RequestCatalogTests
|
||||
|
||||
Assert.AreEqual(new ValueSource(ValueSourceKind.Session, "entry_nonce"), operation.Headers["x-fb-entry-nonce"], operation.Name);
|
||||
Assert.AreEqual(new ValueSource(ValueSourceKind.Constant, "359341"), operation.Headers["x-asbd-id"], "The BDHeaderConfig property is not established.");
|
||||
foreach (var spin in new[] { "__spin_r", "__spin_b", "__spin_t" })
|
||||
// A snapshot of the page at «Ho finito» (decision of 18 November 2026); the operations stay not configured anyway.
|
||||
foreach (var spin in new[] { "spin_r", "spin_b", "spin_t" })
|
||||
{
|
||||
Assert.AreEqual(ValueSourceKind.Pending, operation.Body[spin].Kind, $"{operation.Name} {spin}: who adds it to the request is not shown.");
|
||||
Assert.AreEqual(new ValueSource(ValueSourceKind.Session, spin), operation.Body["__" + spin], $"{operation.Name} __{spin}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -387,17 +391,18 @@ public sealed partial class RequestCatalogTests
|
||||
public void EveryPendingLeftIsARuntimeValueABrowserHeaderOrARemovedName()
|
||||
{
|
||||
// A closed list: what the page computes while it runs (__req, __s, __dyn, __csr, __hblp, __hsdp, __sjsp, __crn,
|
||||
// __d, __spin_*, x-web-session-id), headers of the browser (referer, priority, sec-ch-ua*, x-ig-max-touch-points)
|
||||
// __d, x-web-session-id), headers of the browser (referer, priority, sec-ch-ua*, x-ig-max-touch-points)
|
||||
// and the names the probe removed. Nothing else may stay pending without a decision.
|
||||
var allowed = new HashSet<string>(StringComparer.Ordinal)
|
||||
{
|
||||
"__req", "__s", "__dyn", "__csr", "__hblp", "__hsdp", "__sjsp", "__crn", "__d", "__spin_r", "__spin_b", "__spin_t",
|
||||
"__req", "__s", "__dyn", "__csr", "__hblp", "__hsdp", "__sjsp", "__crn", "__d",
|
||||
"x-web-session-id", "referer", "priority", "sec-ch-ua", "sec-ch-ua-mobile", "sec-ch-ua-platform", "x-ig-max-touch-points",
|
||||
"fb_api_analytics_tags", "qpl_active_flow_ids", RequestCatalog.RemovedName,
|
||||
};
|
||||
var pending = RequestCatalog.LoadInstagram().Operations.SelectMany(o => o.PendingValues).Distinct(StringComparer.Ordinal).ToList();
|
||||
CollectionAssert.AreEqual(Array.Empty<string>(), pending.Where(p => !allowed.Contains(p)).ToArray());
|
||||
Assert.IsFalse(pending.Contains("__rev") || pending.Contains("x-fb-entry-nonce"), "Settled in S4.");
|
||||
Assert.IsFalse(pending.Contains("__spin_r") || pending.Contains("__spin_b") || pending.Contains("__spin_t"), "Settled in S4b.");
|
||||
Assert.AreEqual(0, RequestCatalog.LoadTestSite().Operations.Sum(o => o.PendingValues.Count));
|
||||
}
|
||||
|
||||
@@ -471,7 +476,7 @@ public sealed partial class RequestCatalogTests
|
||||
[TestMethod]
|
||||
public void TheNewSessionFieldsAreAcceptedAndUnknownOnesStillRefused()
|
||||
{
|
||||
foreach (var field in new[] { "rev", "hs", "hsi", "dpr", "ccg", "comet_req", "entry_nonce" })
|
||||
foreach (var field in new[] { "rev", "hs", "hsi", "dpr", "ccg", "comet_req", "entry_nonce", "spin_r", "spin_b", "spin_t" })
|
||||
{
|
||||
var operation = Rest("post2", "/dati/post/{code}");
|
||||
operation["headers"] = new JsonObject { ["user-agent"] = "session:user_agent", ["x-prova"] = "session:" + field };
|
||||
@@ -480,7 +485,7 @@ public sealed partial class RequestCatalogTests
|
||||
Assert.AreEqual(new ValueSource(ValueSourceKind.Session, field), Get(RequestCatalog.Parse(Alone(operation), "richieste.prova.json"), "post2").Headers["x-prova"]);
|
||||
}
|
||||
|
||||
foreach (var field in new[] { "password", "spin_r", "cookie", "sessionid" })
|
||||
foreach (var field in new[] { "password", "spin", "cookie", "sessionid" })
|
||||
{
|
||||
var operation = Rest("post2", "/dati/post/{code}");
|
||||
operation["headers"] = new JsonObject { ["x-prova"] = "session:" + field };
|
||||
|
||||
@@ -91,6 +91,9 @@ public sealed class SessionCaptureIntegrationTests
|
||||
Assert.IsTrue(apiCookie.HostOnly);
|
||||
Assert.AreEqual(TestSite.Lsd, values.Fields["lsd"]);
|
||||
Assert.AreEqual(TestSite.Dpr, values.Fields["dpr"], "a number of the page as text");
|
||||
Assert.AreEqual(TestSite.SpinRevision, values.Fields["spin_r"], "S4b: __spin_r from the page, a number as text");
|
||||
Assert.AreEqual(TestSite.SpinBranch, values.Fields["spin_b"]);
|
||||
Assert.AreEqual(TestSite.SpinTime, values.Fields["spin_t"]);
|
||||
Assert.AreEqual(TestSite.DocIds[TestSite.ProfileQuery], values.DocIds[TestSite.ProfileQuery]);
|
||||
lock (site.World.Gate)
|
||||
{
|
||||
|
||||
@@ -405,14 +405,14 @@ public sealed class SiteSessionTests
|
||||
[TestMethod]
|
||||
public void TheNewPageFieldsAreSessionFieldsAndTheVocabularyIsClosed()
|
||||
{
|
||||
foreach (var field in new[] { "rev", "hs", "hsi", "dpr", "ccg", "comet_req", "entry_nonce", "lsd", "fb_dtsg", "app_id", "account_id" })
|
||||
foreach (var field in new[] { "rev", "hs", "hsi", "dpr", "ccg", "comet_req", "entry_nonce", "spin_r", "spin_b", "spin_t", "lsd", "fb_dtsg", "app_id", "account_id" })
|
||||
{
|
||||
Assert.IsTrue(SiteSessionValues.PageFields.Contains(field), field);
|
||||
Assert.IsTrue(ValueSource.SessionFields.Contains(field), field);
|
||||
}
|
||||
|
||||
CollectionAssert.AreEquivalent(new[] { "user_agent", "claim", "doc_id" }, ValueSource.SessionFields.Except(SiteSessionValues.PageFields).ToArray());
|
||||
Assert.IsFalse(ValueSource.SessionFields.Contains("spin_r"), "__spin_* stay pending: who adds them to the request is not shown.");
|
||||
Assert.IsFalse(ValueSource.SessionFields.Contains("spin"), "The vocabulary is closed.");
|
||||
}
|
||||
|
||||
private static SiteCookie Cookie(string name, string value, DateTimeOffset? expires = null) =>
|
||||
|
||||
@@ -111,7 +111,7 @@ public sealed class TestSiteSessionTests
|
||||
}
|
||||
|
||||
Assert.AreEqual(200, await StatusWith("rev", TestSite.Revision), "the right values pass");
|
||||
foreach (var field in new[] { "rev", "hs", "hsi", "ccg", "dpr", "comet_req", "entry_nonce" })
|
||||
foreach (var field in new[] { "rev", "hs", "hsi", "ccg", "dpr", "comet_req", "entry_nonce", "spin_r", "spin_b", "spin_t" })
|
||||
{
|
||||
Assert.AreEqual(400, await StatusWith(field, "altro-valore"), field);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user