Skip to content

Show a single link in the achievement post shared to X - #74

Open
Tsyklop wants to merge 2 commits into
mainfrom
bug/x-share-duplicate-link
Open

Tsyklop wants to merge 2 commits into
mainfrom
bug/x-share-duplicate-link

Conversation

@Tsyklop

@Tsyklop Tsyklop commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

After a project is completed, the plugin suggests sharing the achievement. Posts shared to X showed the courses link twice:

#HyperskillAchievement unlocked! I've just programmed the Bulls and Cows (Kotlin) application on Hyperskill! Learn more at hyperskill.org/courses hyperskill.org/courses?source…

Posts shared to LinkedIn showed it once.

Cause

buildXShareUrl built the intent from two parts that both carried the link:

  • text was the dialog message, which ends with the short link Learn more at hyperskill.org/courses. X turns a bare domain like that into a link.
  • url was the tracked link with the UTM tags. X appends it to the text.

The LinkedIn intent has no url parameter: its text embeds the tracked link instead, so there was only one link there.

Fix

  • New getShareText() returns the achievement followed by Learn more at <tracked link>. Both X and LinkedIn now use it, so the two posts have the same text.
  • The X intent no longer passes url. The only link is the tracked one, at the end of the text, so the UTM tags still reach Hyperskill.
  • The dialog in the IDE still shows the short link without tracking parameters (getDisplayMessage is unchanged).

X counts every link as 23 characters, so the longer link in the text doesn't affect the post's length limit.

Dead Space repository

The second commit is cherry-picked from #73 without changes. CI for 261 and 262 failed on main's build config: Gradle couldn't resolve the IDE because it first asked maven.pkg.jetbrains.space, which no longer resolves (Temporary failure in name resolution). #73 removes that repository, and its CI is green. The change is identical, so whichever PR merges first, the other merges cleanly and the commit drops out of its diff.

Testing

SocialMediaUtilsTest is new. Its three tests check that:

  • the X intent passes only text, and the text contains the courses link exactly once, at the end;
  • the LinkedIn intent passes shareActive and text, with the same text;
  • the dialog message shows the short link without UTM tags.

It ran on 263 together with the existing SuggestToPostOnProjectCompletionListenerTest: 8/8 passed.

Not covered: no real post was made on X, so how X renders the new text hasn't been checked. The expectation of one link comes from the X behaviour described above. No other platform was run.

The X share intent put "Learn more at hyperskill.org/courses" into the
text and also passed the tracked courses link as the `url` parameter.
X turns the bare domain into a link and appends `url` to the text, so
the post showed two links.

Both X and LinkedIn now share the same text, which ends with the
tracked link, and the X intent no longer passes `url`. The dialog in
the IDE still shows the short link without tracking parameters.
maven.pkg.jetbrains.space no longer resolves: JetBrains Space package
hosting is shut down. Gradle asks repositories in declaration order, and
this one came before the IntelliJ Platform and Marketplace repositories,
so every artifact that was not cached yet failed on it instead of falling
through to the next repository. The new Rust plugin build for 263
(263.7307.313) broke `:intellij-plugin:hs-Rust:compileKotlin` this way,
and any build against a new IDE version would too.

The only artifact taken from it, kotlin-css-jvm 2026.8.4, is on Maven
Central.

(cherry picked from commit 53c5a41)
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

Successfully merging this pull request may close these issues.

1 participant