* Remove the ability to collpase the top graph
This commit removes the ability to collapse the top graph. The graph
collapsed whenever `metric` was falsy. I removed all related code to
that. Metric now defaults to visitors.
We want to add new items to top stats, and this commit will make it
easier to change it. Also, there's currently a bug where top stats is
randomly collapsing, which should be fixed by this commit.
* Refactor graph and top stats loading state
The graph loading state shows and hides the graph conditionally
depending on whether the data is loaded, loading or refreshing.
The current code is a bit difficult to read because its big
conditionals. This commit refactors the loading state making it easier
to read.
This commit also fixes a bug where the graph wasn't fading out when
changing metrics.
* Changes to the site settings danger zone
The idea was to:
1. Show a transfer site ownership message to owners of the site only. This will make ownership transfer feature more discoverable. Will also help people to transfer ownership of a site rather than deleting the whole thing when that makes more sense
2. Add a note that site deletion is a delayed operation
3. Make some other tiny copy changes
What did I break? :)
* Fix markup so the long text wraps sooner
* Fix indent
---------
Co-authored-by: Adam Rutkowski <hq@mtod.org>
* Move Endpoint errors setup to common config
* Implement naive Sentry link resolver
* Implement error report e-mail
* Delete static sentry script
* Implement user feedback form on server errors
* Re-arrange pipe
* Use Sentry.Config.dsn() where applicable
* Fix typo
* Use Map.replace/3
Some changes to be more consistent with the emails we send. Also "valid" subscription rather than "active" subscription fits better for the different cases where this screen is shown
* fix subquery for sessions in base_event_query/2
As the 'sessions' table is using the CollapsingMergeTree engine, we have
to select session_id's distinctively. Otherwise we will get multiple rows
(with sign -1 and 1) as long as the background merge hasn't happened.
* update changelog
* use GROUP BY instead of SELECT DISTINCT
* remove comma
* Fingerprint DBConnection.ConnectionError in Sentry
* Check events before creating a site
* Enable sites limit screen
* Remove debugging remnant
* Fix buggy assertions
This wasn't doing what expected:
iex(1)> Repo.exists?(Plausible.Site, domain: "foo")
[debug] QUERY OK source="sites" db=0.6ms idle=1906.2ms
SELECT TRUE FROM "sites" AS s0 LIMIT 1 []
* Encapsulate check to satisfy credo
* Use less technically involved error message
* Bring back e-mail to the limit error message
This commit stops logging `{:invalid_address, "ip"}` errors. This
reduces noise on Sentry, that is capturing error logs. Other errors are
still logged.
* extract maybeUpdateMetric function
* reset graph metric after fetching top stats
* fix bug
Also make sure we do not allow 'metric' to become undefined anymore
* keep graph hidden when empty metric saved
* reset metric in setState callback
* pass function not call
This PR replaces geolix with locus to simplify self-hosted setup. locus can auto-update maxmind dbs which are recommended for self-hosters if they want city-level geolocation. locus is also a bit faster.
This PR also uses a test mmdb file from https://github.com/maxmind/MaxMind-DB for e2e geolocation tests without stubs.
* extract blinkingDot function
* position pulsating-circle with tailwind instead
* remove unused function
* extract renderStatName function
* display seconds since last realtime update
Adds a 'Last updated X seconds ago' label to the Current Visitors tooltip.
* small refactor: avoid duplication of this.props and this.state
* show the 'last updated ...' tooltip in historical
* changelog update
* use className utility function
* Filter DBConnection logs for clickhouse in Sentry
Removing the never matching clause btw
* Exclude Plug.CSRFProtection.InvalidCSRFTokenError from Sentry
* Turn common Sentry captures into logged warnings
* Exclude fonts from static conf and InvalidPathError from Sentry
* Add Checkly Terraform config
* add deployment workflow
* use pagerduty instead of email for notifications
* use terraform cloud backend
* update variable declaration
* rename checkly check group
* update syntax
* test trigger
* Revert "test trigger"
This reverts commit 333e82beac.
* run a single job at a time
Co-authored-by: Cenk Kücük <c@cenk.me>
* Consolidate task timeouts, incrase to 15s
* Use Task.async_stream for parallel Clickhouse queries
* Propagate Opentelemetry context to child Task process
* Fix breakdown API pagination when using event metrics
This commit fixes a bug where the subsequent breakdown API pages had
the same items as the first page. The fix sorts the underlying
ClickHouse query by timestamp, keeping the same order between requests,
as we use OFFSET/LIMIT pagination.
* Fix repeated results assertion
* Add different ORDER BY to each breakdown property
* Ignore XX and T1 countries
* Add fallback if country_code=nil
* Lookup city overrides directly in CityOverrides module
* Changelog
* Add empty moduledoc
* Remove redundant comment
* add a new realtime-update-timer module
* hook to the new 'tick' event in ListReport for auto-updates
This commit fixes the bug where all reports using the `ListReport` component did not
auto-update in realtime mode. Those reports are:
- Pages (Top / Entry / Exit)
- Locations (Countries / Regions / Cities)
- Devices (Screen Sizes / Browsers + versions / OS-s + versions)
* fetch data for ListReports only when scrolled into view
* refactor fetching data in ListReport
* refer to one source of truth for utm tags
* make the 'All' tab in Sources auto-update
* make all UTM tabs in Sources auto-update
* fetch UTM data only when scrolled into view
* auto-update Referrers with the new timer
* auto-update google search terms
* auto-update Conversions
* make countries map auto-update
* auto-update visitor-graph and top stats with new timer
* use new tick event for current visitors (in Historical)
* remove the old timer class
* update changelog
* Visual improvements to automatic realtime updates (#2532)
* minor consistency fix for text color in dark mode
* use FlipMove in goal conversions report
* use FlipMove in ListReports
* set main graph and top stats loading state correctly
* refactor isIntervalValid function
* enforce intervals are valid when set and stored
* remove duplicate data fetching on interval change
Fetching new data is handled by the `fetchGraphData` callback in `updateInterval`
* refactor updateMetric function
* make it clearer why 'metric' can be a faulty value
* extract 'query' and 'site' variables from 'this.props'
* reset interval state only when period is changed
The 'maybeRollbackInterval' function was also used to fetch data. This commit replaces
all those function calls with 'fetchGraphData' which better describes the actual behavior.
We should only worry about rolling back the interval if 'query.period' has changed.
This commit also stops the graph from flickering when it is updated in realtime.
* update names of two variables
* remove unnecessary negation
* make collapsed graph state more explicit
* consider stored invalid intervals when graph mounts
* fix not showing loading spinner regression
* remove interval state from VisitorGraph (#2540)
* Realtime prop breakdown (#2535)
* disable load more in realtime mode
* extract doFetch function
* separate fetchPropBreakdown and fetchNextPage functions
* subscribe for auto-updates in realtime
* improve readability with function name changes
* Cascade delete sent_renewal_notifications table when user is deleted
This commit fixes a bug when deleting a user would trigger a constraint
error.
* Update CHANGELOG.md
* Set pg pool size for MIX_ENV=test
* Include slow tests in CI run
* Exclude slow tests by default
* Mark tests slow/async where applicable
* Restructure captcha mocks
* Revert async where env is relied upon
* Add --max-failures=1 to CI run
* Set warnings as errors
* Disable async where various mocks are used
* Revert "Disable async where various mocks are used"
This reverts commit 2446b72a29.
* Disable async for test using vcr
* Return empty list when breaking down by event:page without events
This commit fixes a bug with pagination where breaking down by event:page
would always return results despite pagination.
Closes#2255
* Update CHANGELOG.md
* Remove show_noref behaviour
Removes query param show_noref which was used from React to control
whether to show Direct / None traffic or not. The show_noref behaviour
was untested previously.
Closes#2523
* Add changelog entry
* Fix tests
* Removed files I did not mean to check in :)