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] Snowplow route not returning postData #27122

Closed
corr155 opened this issue Sep 15, 2023 · 2 comments
Closed

[BUG] Snowplow route not returning postData #27122

corr155 opened this issue Sep 15, 2023 · 2 comments

Comments

@corr155
Copy link

corr155 commented Sep 15, 2023

System info

  • Playwright Version: [v1.36.1]
  • Operating System: [macOS 13.4.1]
  • Browser: [All]

Source code

Test.spec.ts

test("Send a snowplow event when company.com loads", async ({ page }) => {
  await page.route(
    "https://snowplow-dev.company.com/com.snowplowanalytics.snowplow/tp2**",
    async (route, request) => {
      const postData = JSON.parse(request.postData() ?? "{}");

      expect(postData[0]).toBeDefined()

      route.fulfill({
        body: "ok",
      });
    }
  );
 await page.getByLabel("widget").click();
});

Here is the network call with data in the body

Request URL:
https://snowplow.company.com/com.snowplowanalytics.snowplow/tp2
Request Method:
POST
Status Code:
200
Remote Address:
54.243.140.170:443
Referrer Policy:
strict-origin-when-cross-origin
Access-Control-Allow-Credentials:
true
Access-Control-Allow-Origin:
https://www.company.com
Content-Length:
2
Content-Type:
text/plain; charset=UTF-8
Date:
Fri, 15 Sep 2023 14:39:23 GMT
P3p:
policyref="/w3c/p3p.xml", CP="NOI DSP COR NID PSA OUR IND COM NAV STA"
Server:
akka-http/10.1.12
Set-Cookie:
collector_cookie=f6538c85-b66c-4859-8f4e-a1017c92755f; Expires=Sat, 14 Sep 2024 14:39:23 GMT; Path=/
:authority:
snowplow.company.com
:method:
POST
:path:
/com.snowplowanalytics.snowplow/tp2
:scheme:
https
Accept:
*/*
Accept-Encoding:
gzip, deflate, br
Accept-Language:
en-US,en;q=0.9
Content-Length:
1235
Content-Type:
application/json
Origin:
https://www.company.com
Referer:
https://www.company.com/
Sec-Ch-Ua:
"Chromium";v="116", "Not)A;Brand";v="24", "Google Chrome";v="116"
Sec-Ch-Ua-Mobile:
?0
Sec-Ch-Ua-Platform:
"macOS"
Sec-Fetch-Dest:
empty
Sec-Fetch-Mode:
cors
Sec-Fetch-Site:
cross-site
User-Agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36

Here is the payload

{"schema":"iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-4","data":[{"se_ca":"pageActions","se_ac":"render","se_pr":"{\"appVersion\":\"1.0.0\",\"betaName\":\"1.0.0\",\"gid\":\"0\",\"contentSelector\":\".single .entry-content\"}","aid":"aid","cd":"24","cookie":"1","cs":"UTF-8","dtm":"1694788762769","ds":"1905x9284","duid":"duid","e":"se","eid":"id","lang":"en-US","p":"web","refr":"https://www.google.com/","res":"1920x1080","sid":"sid","tna":"prod","tv":"0.1.0","tz":"America/New_York","ua":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36","url":"https://www.company.com/","vid":"1","vp":"1920x663","stm":"1694788762769"}]}

Steps

  • Run with Debug
  • Noticed that request.postData() and request.postDataFromBuffer() are both null

Expected

  • Payload above would be returned in postData() and not null
  • NOTE: there are several snowplow events happening on load and the expectation is that I would fallback for the events that are not matching the postData I am looking for

Actual

  • request.postData() and request.postDataFromBuffer() are both null
  • falling back to the next event does not return any postdata as well
@dgozman
Copy link
Contributor

dgozman commented Sep 15, 2023

@corr155 Could you please provide a repro that we can run locally? https://snowplow.company.com does not load for me.

Most likely, this is a duplicate of #6479, so unless there is a repro, I am going to merge it in.

@aslushnikov
Copy link
Collaborator

Looks like the discussion has stalled here, so I'll close this. If you still think we can be helpful, then please feel free to file a new issue!

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

3 participants