luckyframework / luckyframework/lucky

Links include default param in url in 0.24

Open
#1,279 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Crystal
Stars
2.7k
Forks
172
PR merge metrics
No merged PRs in 30d

Description

I noticed that after I upgraded to 0.24 it started including the query in links even if they are not really set and should use the default values.

This is deployed in production on Kindmetrics as it does work but doesn't look nice. You can see at the demo:
https://app.kindmetrics.io/share/851Jv1PW

Click on pages or sources and you can see the URL have all queries with default values.

I use this code to generate the URLs (which worked prev 0.24):

Domains::Show.with(domain_id: domain.id, goal_id: goal.try { |g| g.id } || 0_i64, site_path: row.address.to_s, source_name: source_name, medium_name: medium_name, from: time_to_string(from), to: time_to_string(to)).url

This would be nice to get fixed as it doesn't look nice :)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Domains::Show.with(...).url entry point and reproduce the default query parameters using the linked Kindmetrics demo. Trace how URL generation serializes default values, then verify that generated links omit parameters that remain at their defaults.

Written by the indexing model from the issue text.

Assessment

Tech stack
crystal
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.