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

Fix Mis-typed claimLink #7210

Merged
merged 1 commit into from
Oct 1, 2021
Merged

Fix Mis-typed claimLink #7210

merged 1 commit into from
Oct 1, 2021

Conversation

rafael-xmr
Copy link
Collaborator

@rafael-xmr rafael-xmr commented Oct 1, 2021

Fixes

Issue Number: Closes #7208

here https://odysee.com/@Super-Grand-Ad:f?view=about can be seen the user had a mis-typed mention on the 'Description', and getValidClaim was intended to only keep going in case of a failed claim that has a punctuation mark at the end, and not for non existent claims

PR Checklist

Toggle...

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting)
  • Refactoring (no functional changes)
  • Documentation changes
  • Other - Please describe:

Please check all that apply to this PR using "x":

  • I have checked that this PR is not a duplicate of an existing PR (open, closed or merged)
  • I added a line describing my change to CHANGELOG.md
  • I have checked that this PR does not introduce a breaking change
  • This PR introduces breaking changes and I have provided a detailed explanation below

@rafael-xmr rafael-xmr changed the title Fix resolving invalid claims Fix Mis-typed claimLink Oct 1, 2021
@tzarebczan tzarebczan merged commit 56817d4 into master Oct 1, 2021
@tzarebczan tzarebczan deleted the channel-mention branch October 1, 2021 16:00
jessopb pushed a commit that referenced this pull request Nov 13, 2021
Implement Download Progress

Revert "Stream Key Button (#7127)"

I forgot to lint before merging. Reverting for now, will fix in a bit.

This reverts commit 5c88783.

Restore "Stream Key Button (#7127)" + lint and modifications

- Consolidate functionality into existing component.
- Use proper strings.

Localize sunset nag

Changed the text a bit so that we can re-use the existing 'Learn more'.

Don't allow assigning yourself as moderator

Also fixed split-string (hard to localize).

Comment: Swap the order of "Edit" and "Remove"

This order is more common.

Blocklist page: fix perpetual spinner when trying to refresh with no channels

There's nothing to do when you don't have a channel, so hide the button and ensure redux fails gracefully.

i18n

Livestream category improvements (#7115)

* ❌ Remove old method of displaying active livestreams

Completely remove it for now to make the commit deltas clearer.
We'll replace it with the new method at the end.

* Fetch and store active-livestream info in redux

* Tiles can now query active-livestream state from redux instead of getting from parent.

* ⏪ ClaimTilesDiscover: revert and cleanup

- Simplify to just `uris` instead of having multiple arrays (`uris`, `modifiedUris`, `prevUris`)
- The `prevUris` is for CLS prevention. With this removal, the CLS issue is back, but we'll handle it differently later.
- Temporarily disable the view-count fetching. Code is left there so that I don't forget.

- `shouldPerformSearch` was never true when `prefixUris` is present. Corrected the logic.
- Aside: prefix and pin is so similar in function. Hm ....

* ClaimTilesDiscover: factor out options

Move the `option` code outside and passed in as a pre-calculated prop.

To skip rendering while waiting for `claim_search`, we need to add `React.memo(areEqual)`. However, the flag that determines if we are fetching `claim_search` (fetchingClaimSearchByQuery[]) depends on the derived options as the key.

Instead of calculating `options` twice, we moved it to the props so both sides can use it.

It also makes the component a bit more readable.

The downside is that the prop-passing might not be clear.

* ClaimTilesDiscover: reduce ~17 renders at startup to just 2.

* ClaimTilesDiscover: fill with placeholder while waiting for claim_search

Livestream claims are fetched seperately, so they might already exists. While claim_search is running, the list only consists of livestreams (collapsed).

Fill up the space with placeholders to prevent layout shift.

* Add 'useFetchViewCount' to handle fetching from lists

This effect also stashes fetched uris, so that we won't re-fetch the same uris during the same instance (e.g. during infinite scroll).

* ⏪ ClaimListDiscover: revert and cleanup

- Removed the 'finalUris' stuff that was meant to "pause" visual changes when fetching. I think it'll be cleaner to use React.memo to achieve that.

- Added `renderUri` to make it clear which array that this component will render.
- Re-do the way we fetch view counts now that 'finalUris' is gone. Not the best method, but at least correct for now.

* ClaimListDiscover: add prefixUris, similar to ClaimTilesDiscover

This will be initially used to append livestreams at the top.

* ✅ Re-enable active livestream tiles using the new method

* doFetchActiveLivestreams: add interval check

- Added a default minimum of 5 minutes between fetches. Clients can bypass this through `forceFetch` if needed.

* doFetchActiveLivestreams: add option check

We'll need to support different 'orderBy', so adding an "options check" when determining if we just made the same fetch.

* WildWest: limit livestream tiles + add ability to show more

Most likely this behavior will change in the future, so we'll leave `ClaimListDiscover` untouched and handle the logic at the page level.

This solution uses 2 `ClaimListDiscover` -- if the reduced livestream list is visible, it handles the header; else the normal list handles the header.

* Use better tile-count on larger screens.

Used the same method as how the homepage does it.

Fix video embeds in comments not playing and resize issues (#7163)

-- tmp revert --

This reverts commit 3b47edc to allow putting back in the original commits.

❌ Remove old method of displaying active livestreams

Completely remove it for now to make the commit deltas clearer.
We'll replace it with the new method at the end.

Fetch and store active-livestream info in redux

Tiles can now query active-livestream state from redux instead of getting from parent.

⏪ ClaimTilesDiscover: revert and cleanup

- Simplify to just `uris` instead of having multiple arrays (`uris`, `modifiedUris`, `prevUris`)
- The `prevUris` is for CLS prevention. With this removal, the CLS issue is back, but we'll handle it differently later.
- Temporarily disable the view-count fetching. Code is left there so that I don't forget.

- `shouldPerformSearch` was never true when `prefixUris` is present. Corrected the logic.
- Aside: prefix and pin is so similar in function. Hm ....

ClaimTilesDiscover: factor out options

Move the `option` code outside and passed in as a pre-calculated prop.

To skip rendering while waiting for `claim_search`, we need to add `React.memo(areEqual)`. However, the flag that determines if we are fetching `claim_search` (fetchingClaimSearchByQuery[]) depends on the derived options as the key.

Instead of calculating `options` twice, we moved it to the props so both sides can use it.

It also makes the component a bit more readable.

The downside is that the prop-passing might not be clear.

ClaimTilesDiscover: reduce ~17 renders at startup to just 2.

ClaimTilesDiscover: fill with placeholder while waiting for claim_search

Livestream claims are fetched seperately, so they might already exists. While claim_search is running, the list only consists of livestreams (collapsed).

Fill up the space with placeholders to prevent layout shift.

Add 'useFetchViewCount' to handle fetching from lists

This effect also stashes fetched uris, so that we won't re-fetch the same uris during the same instance (e.g. during infinite scroll).

⏪ ClaimListDiscover: revert and cleanup

- Removed the 'finalUris' stuff that was meant to "pause" visual changes when fetching. I think it'll be cleaner to use React.memo to achieve that.

- Added `renderUri` to make it clear which array that this component will render.
- Re-do the way we fetch view counts now that 'finalUris' is gone. Not the best method, but at least correct for now.

ClaimListDiscover: add prefixUris, similar to ClaimTilesDiscover

This will be initially used to append livestreams at the top.

✅ Re-enable active livestream tiles using the new method

doFetchActiveLivestreams: add interval and options checking

- Added a default minimum of 5 minutes between fetches. Clients can bypass this through `forceFetch` if needed.
- We'll need to support different 'orderBy', so adding an "options check" when determining if we just made the same fetch.

WildWest: limit livestream tiles + add ability to show more

Most likely this behavior will change in the future, so we'll leave `ClaimListDiscover` untouched and handle the logic at the page level.

This solution uses 2 `ClaimListDiscover` -- if the reduced livestream list is visible, it handles the header; else the normal list handles the header.

Fix homepage tiles not filtering blocked channels

7165 homepage queries don't take into account blocked channel ids (mute does)

resolveSearchOptions: was not grabbing redux data correctly.

Adjust comment fade-out height

6944 Comment expansion sometimes doesn't reveal extra text (already showing everything)

Reconcile some constants between JS and CSS.

force mp3 extension vs mpga

Fix autoplay next default value (#7173)

Fix missed render when blocklist is fetched

7176

Pitfalls of pausing render via React.memo:
  - We'll miss the `doClaimSearch()` since that is sparked by an `useEffect`.

Seems like we can't avoid having a redundant copy of the previously-displayed URIs.

Memoize 'mutedAndBlockedChannelIds'

It was being recalculated repeatedly.

This memoizes it, although it still re-calculates occasionally despite none of the source arrays changed. I think it is due to the state change in the Preference Sync.

Note: input selectors to `createSelector` needs to be extractions-only (i.e. must not have transformations). I think most of our `makeSelect*` selectors violate this and broke memoization.

Fix “Your Account” popup on mobile (#5652) (#7172)

* Fix “Your Account” popup on mobile (#5652)

* Update changelog

Co-authored-by: Branko Tomic <branko@spicefactory.co>

Fix issue where channel upload viewcounts were creating a new line (#7154)

* fix issue where viewcounts were creating a new line

* conditionally add large view css

* conditionally apply class based on if view count should be shown

* last couple touchups

* clean up the css

* add scss to flow config

* add scss component to flow config

use homepage LATEST for following discover (#7185)

Commentron now includes `replies` for `ByID` request

Wasn't aware of that, and that was causing 7146 ("show replies" visible when there are no replies).

Fix page titles for SiteLinks

Part of `7166 improve search metadata`, where page titles are important clues for Google to generate Site-Links.

Add icons (#7194)

fix playlist resolving collectionurls (#7178)

* fix playlist resolving collectionurls

* Update CHANGELOG.md

Co-authored-by: Thomas Zarebczan <tzarebczan@users.noreply.github.com>

Fix plant icon (#7195)

* Fix plant icon

* Also change phone icon name

Add Channel Mention selection ability (#7151)

* Add Channel Mention selection ability

* Fix mentioned user name being smaller than other text

* Improve logic for locating a mention

* Fix mentioning with enter on livestream

* Fix breaking for invalid URI query

* Handle punctuation after mention

* Fix name display and appeareance

* Use canonical url

* Fix missing search

i18n - ChannelMention and other fixes

Fix wrong 'recsysId' sent due to search-key mismatch

.../archives/C02FQBM00Q0/p1633044695010600

When querying a search key, it has to be an exact match. This was broken by the insertion of `free_only` in the fetch.

Added a function to generate the options, so that all clients stay in sync.

Fix linked-comment scrolling

I think this the best solution so far, at the expense of a slight delay in scrolling if the network call stalls.

- Added "fetching by ID" state so that we don't need to use the ugly N-retries method.
- `scrollIntoView` doesn't work if the element is already in the viewport, and the `scrollBy` adjustment doesn't take into account the y-position restoration that we perform on certain type of pages. Use `window.scrollTo` instead and taking into account current scroll position.

Prevent random description in Google Search results for "odysee" (#7206)

7166 improve search metadata

Depending on the search term and timing, Google extracts data from the sidebar or page content to use as the search-result description.

Defined `description` (on top of the existing `og:description` and `twitter:description`.

While I couldn't find a definitive doc saying that this is the solution, this is present in all other sites (and matches their description in a Google Search results).

Add favicon for Google Search results (#7205)

- A side-quest from "7166 improve search metadata".
- The favicon must be from the same domain as the homepage, so the CDN URL couldn't be used, hence the additional upload.
- The favicon also needs to be multiples of 48x48 and above.
    - Wanted to use SVG for the smallest size possible, but seems like Safari does not fully support it. Got Dejan to give me a reasonably-sized PNG.

https://developers.google.com/search/docs/advanced/appearance/favicon-in-search#guidelines

List own comments (#7171)

* Add option to pass in url-search params.

Impetus: allow linked comment ID and setting the discussion tab when clicking on the `ClaimPreview`.

* comment.list: fix typos and renamed variables

- Switch from 'author' to 'creator' to disambiguate between comment author and content author. For comment author, we'll use 'commenter' from now on.
- Corrected 'commenterClaimId' to 'creatorClaimId' (just a typo, no functional change).

* doCommentReset: change param from uri to claimId

This reduces one lookup as clients will always have the claimID ready, but might not have the full URI.

It was using URI previously just to match the other APIs.

* Add doCommentListOwn -- command to fetch own comments

Since the redux slice is set up based on content or channel ID (for Channel Discussion page), re-use the channel ID for the case of "own comments". We always clear each ID when fetching page-0, so no worries of conflict when actually browsing the Channel Discussion page.

* Comment: add option to hide the actions section

* Implement own-comments page

* Use new param to remove sort-pins-first.

comment.List currently always pushes pins to the top to support pagination. This new param removes this behavior.

Fix resolving invalid claims (#7210)

Update icons.js

--- tmp revert ---

This reverts commit de6c6f9.

Add option to pass in url-search params.

Impetus: allow linked comment ID and setting the discussion tab when clicking on the `ClaimPreview`.

comment.list: fix typos and renamed variables

- Switch from 'author' to 'creator' to disambiguate between comment author and content author. For comment author, we'll use 'commenter' from now on.
- Corrected 'commenterClaimId' to 'creatorClaimId' (just a typo, no functional change).

doCommentReset: change param from uri to claimId

This reduces one lookup as clients will always have the claimID ready, but might not have the full URI.

It was using URI previously just to match the other APIs.

Add doCommentListOwn -- command to fetch own comments

Since the redux slice is set up based on content or channel ID (for Channel Discussion page), re-use the channel ID for the case of "own comments". We always clear each ID when fetching page-0, so no worries of conflict when actually browsing the Channel Discussion page.

Comment: add option to hide the actions section

Implement own-comments page

Use new param to remove sort-pins-first.

comment.List currently always pushes pins to the top to support pagination. This new param removes this behavior.

Corrected meta for "description" (patch for #7206)

It should be `name`, not `property`. Copy-paste error from the OG version.

Fix 'pinnedUrl' error.

Part of "6989 Fix console spam in dev"

EXTRA_SIDEBAR_LINKS should be a `SideNavLink` object, so trim down the return object from `GetLinksData`.

Temp workaround SDK 0 count

Temp workaround claims in channel count 0

patch creator analytics with hub without channel claim count

patch hubs claims_in_channel temporarily

OG: fix url for categories

Category cards are showing up as "odysee.com" cards in Facebook.

- `og:url` is supposed to be the canonical URL. It was hardcoded to "odysee.com", so every category was being redirected when the card is being generated.
- Removed `twitter:url`. The documentation says it will fall back to `og:url`, so there is not need to define both if it's the same.

OG: Technology category missing due to rename

- 'technology' was renamed to 'tech'.
- Leave both entries there for now. Not sure if other homepages still use the old link or not.

Fix spacing / centering live stream + comments section (#7225)

Add copy comment link menu option (#7224)

adjust css for toast message so that it behaves as expected (text truncation via ellipsis) (#7213)

Refactor commentsList

Remove expand/collapse from channel discussion page

Prevent comment content from breaking the layout on mobile

ESLint fix

Update Dark theme and fix playing issue

Fix playlist strings

Add sitemap to influence Sitelinks

Part of `7166 improve search metadata`

This is an experiment to influence the Sitelinks in our search results. Our current sitemap only consists of claims, so claims appear in Sitelinks more often. We (Julian) want categories to have higher priority, if possible.

For now, the sitemap will be defined in Google Console instead of robots.txt.

If it works, the file should be uploaded to sitemap.odysee.com, alongside the claim list sitemap.

Revert "Add sitemap to influence Sitelinks"

Seems like I messed up robots.txt?

This reverts commit 9565495.

Bump url-parse from 1.5.1 to 1.5.3 (#7230)

Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.1 to 1.5.3.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](unshiftio/url-parse@1.5.1...1.5.3)

---
updated-dependencies:
- dependency-name: url-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

fix notifications page on unauthed app (#7226)

move file actions from lbry-redux

Send video bitrate and user bandwidth to Watchman (#7145)

* adding functionality to detect user download speed

* calculating bandwidth speed more intelligently

* saving download speed and updating it every 30s

* all the functionality should be done needs testing

* fix linting

* use a 1mb file for calculating bandwidth

* add optional chaining plugin to babel and get bitrate from texttrack

* allow optional chaining for flow

* ignore flow error

* disable bandwidth checking functionality

* fix flow error

Fix ESLint

Update Download Progress

Update CSS
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.

Specific channel page crashes after some recent changes
2 participants