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

Set root domain (none) for ingests without hostname #4678

Merged
merged 3 commits into from
Oct 15, 2024

Conversation

aerosol
Copy link
Member

@aerosol aerosol commented Oct 15, 2024

Changes

This is not a bug, but more of a micro-optimization. If the hostname is known to be (none), there's no need try and compute root domain.

👀 At the same, it looks like ingestion had a dead clause trying to match nil hostname. Plausible.Ingestion.Request should reject such cases before they reach Plausible.Ingestion.Event processing.

Ref https://3.basecamp.com/5308029/buckets/26383192/card_tables/cards/7916301991

Tests

  • Automated tests have been added
  • This PR does not require tests

Changelog

  • Entry has been added to changelog
  • This PR does not make a user-facing change

Documentation

  • Docs have been updated
  • This change does not need a documentation update

Dark mode

  • The UI has been tested both in dark and light mode
  • This PR does not change the UI

@@ -541,6 +541,7 @@ defmodule Plausible.Ingestion.Event do
end
end

defp get_root_domain("(none)"), do: "(none)"
defp get_root_domain(nil), do: "(none)"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 at this point hostname shouldn't ever be nil - rejected at the requested creation level at best

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

Preview environment👷🏼‍♀️🏗️
PR-4678

lib/plausible/ingestion/request.ex Outdated Show resolved Hide resolved
@aerosol aerosol added this pull request to the merge queue Oct 15, 2024
Merged via the queue into master with commit 023e204 Oct 15, 2024
10 checks passed
@aerosol aerosol deleted the quicker-hostname-none branch November 6, 2024 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants