Skip to content

I did not set the token  #7218

Closed as not planned
Closed as not planned

Description

@ilike2burnthing

Description

Previously working, but no longer. Confirmed in Windows Sandbox with default addon/extension settings to remove any other causes. Tried versions back to v23.11.1 on Firefox to make sure it wasn't a regression.

How to replicate the issue + URL

Access https://github.com/refined-github/refined-github/blob/esbuild-2/source/features/default-branch-button.tsx and see no default branch button.

Extension version

24.1.10

Browser(s) used

Edge and Firefox

Activity

  1. busches commented on Jan 14, 2024

    @busches
    Member

    I cleared RGH's cache, went to the page and see it make the GraphQL call in the console:
    image
    And the button appears:
    image

    What errors/messages do you have in the console?

  2. ilike2burnthing commented on Jan 15, 2024

    @ilike2burnthing
    ContributorAuthor
    scheduler.production.min.js:1 [Violation] 'message' handler took 480ms
    [Violation] Forced reflow while executing JavaScript took 37ms
    7Fetch finished loading: GET "<URL>".
    refined-github.js:4094 Fetch finished loading: GET "https://api.github.com/repos/refined-github/yolo/contents/broken-features.csv".
    fetchHotfix @ refined-github.js:4094
    updater @ refined-github.js:4099
    getSet @ refined-github.js:2257
    (anonymous) @ refined-github.js:2270
    await in (anonymous) (async)
    get @ refined-github.js:2273
    (anonymous) @ refined-github.js:4129
    getLocalHotfixesAsOptions @ refined-github.js:4130
    (anonymous) @ refined-github.js:4181
    (anonymous) @ refined-github.js:4180
    (anonymous) @ refined-github.js:12741
    (anonymous) @ refined-github.js:12742
    Show 11 more frames
    Show less
    refined-github.js:4094 Fetch finished loading: GET "https://api.github.com/repos/refined-github/yolo/contents/strings.json".
    fetchHotfix @ refined-github.js:4094
    updater @ refined-github.js:4146
    getSet @ refined-github.js:2257
    (anonymous) @ refined-github.js:2270
    await in (anonymous) (async)
    get @ refined-github.js:2273
    preloadSyncLocalStrings @ refined-github.js:4142
    (anonymous) @ refined-github.js:4181
    (anonymous) @ refined-github.js:4180
    (anonymous) @ refined-github.js:12741
    (anonymous) @ refined-github.js:12742
    Show 10 more frames
    Show less
    include-fragment-element-hacks.ts:5 Fetch finished loading: GET "https://github.com/refined-github/refined-github/security/overall-count".
    window.IncludeFragmentElement.fetch @ include-fragment-element-hacks.ts:5
    c @ index.js:184
    await in c (async)
    a @ index.js:162
    o @ index.js:131
    attributeChangedCallback @ index.js:59
    27034 @ index.js:208
    s @ bootstrap:19
    60084 @ vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_primer_view-co-eb424d-1f1d46301f70.js:1
    s @ bootstrap:19
    10361 @ github-elements-d05741cabc64.js:1
    s @ bootstrap:19
    t @ github-elements-d05741cabc64.js:5
    (anonymous) @ github-elements-d05741cabc64.js:5
    s.O @ chunk loaded:23
    (anonymous) @ github-elements-d05741cabc64.js:5
    _ @ jsonp chunk loading:71
    (anonymous) @ github-elements-d05741cabc64.js:1
    Show 5 more frames
    Show less
    include-fragment-element-hacks.ts:5 Fetch finished loading: GET "https://github.com/settings/two_factor_authentication/holiday_warning_banner".
    window.IncludeFragmentElement.fetch @ include-fragment-element-hacks.ts:5
    c @ index.js:184
    await in c (async)
    a @ index.js:162
    o @ index.js:131
    attributeChangedCallback @ index.js:59
    27034 @ index.js:208
    s @ bootstrap:19
    60084 @ vendors-node_modules_github_file-attachment-element_dist_index_js-node_modules_primer_view-co-eb424d-1f1d46301f70.js:1
    s @ bootstrap:19
    10361 @ github-elements-d05741cabc64.js:1
    s @ bootstrap:19
    t @ github-elements-d05741cabc64.js:5
    (anonymous) @ github-elements-d05741cabc64.js:5
    s.O @ chunk loaded:23
    (anonymous) @ github-elements-d05741cabc64.js:5
    _ @ jsonp chunk loading:71
    (anonymous) @ github-elements-d05741cabc64.js:1
    Show 5 more frames
    Show less
    verified-fetch.ts:27 Fetch finished loading: GET "https://github.com/refined-github/refined-github/latest-commit/esbuild-2/source/features/default-branch-button.tsx".
    r @ verified-fetch.ts:27
    a @ verified-fetch.ts:58
    l @ use-latest-commit.ts:9
    (anonymous) @ index.js:11
    t @ use-latest-commit.ts:74
    (anonymous) @ use-latest-commit.ts:92
    oO @ react-dom.production.min.js:244
    uB @ react-dom.production.min.js:286
    u_ @ react-dom.production.min.js:273
    r4 @ react-dom.production.min.js:127
    (anonymous) @ react-dom.production.min.js:283
    uO @ react-dom.production.min.js:283
    uS @ react-dom.production.min.js:269
    x @ scheduler.production.min.js:13
    R @ scheduler.production.min.js:14
    Show 10 more frames
    Show less
    verified-fetch.ts:27 Fetch finished loading: GET "https://github.com/refined-github/refined-github/deferred-metadata/esbuild-2/source/features/default-branch-button.tsx".
    r @ verified-fetch.ts:27
    a @ verified-fetch.ts:58
    t @ DeferredMetadataContext.tsx:57
    (anonymous) @ DeferredMetadataContext.tsx:77
    oO @ react-dom.production.min.js:244
    uB @ react-dom.production.min.js:286
    u_ @ react-dom.production.min.js:273
    r4 @ react-dom.production.min.js:127
    (anonymous) @ react-dom.production.min.js:283
    uO @ react-dom.production.min.js:283
    uS @ react-dom.production.min.js:269
    x @ scheduler.production.min.js:13
    R @ scheduler.production.min.js:14
    Show 9 more frames
    Show less
    fetch-utils.ts:74 Fetch finished loading: GET "https://github.com/notifications/indicator".
    (anonymous) @ fetch-utils.ts:74
    setTimeout (async)
    (anonymous) @ fetch-utils.ts:70
    i @ fetch-utils.ts:69
    d @ fetch-utils.ts:90
    fetchIndicatorMode @ notification-indicator-element.ts:96
    connectedCallback @ notification-indicator-element.ts:18
    connectedCallback @ core.js:44
    CatalystDelegate.t.connectedCallback @ core.js:12
    set @ attr.js:61
    b @ attr.js:78
    attributeChangedCallback @ core.js:52
    CatalystDelegate.t.attributeChangedCallback @ core.js:20
    (anonymous) @ register.js:12
    CatalystDelegate @ register.js:24
    A @ controller.js:9
    a @ chunk-app_components_site_header_notification-indicator-element_ts-1a13d1d504e7.js:1
    26056 @ notification-indicator-element.ts:5
    s @ bootstrap:19
    Promise.then (async)
    (anonymous) @ element-registry.ts:96
    Promise.then (async)
    (anonymous) @ lazy-define.js:58
    requestAnimationFrame (async)
    M @ lazy-define.js:50
    S @ lazy-define.js:70
    48293 @ element-registry.ts:170
    s @ bootstrap:19
    (anonymous) @ element-registry-76246d26c47d.js:1
    _ @ jsonp chunk loading:71
    (anonymous) @ element-registry-76246d26c47d.js:1
    Show 12 more frames
    Show less
    refined-github.js:4268 ↩️ Skipping wait-for-checks
    refined-github.js:4268 ↩️ Skipping update-pr-from-base-branch
    refined-github.js:4268 ↩️ Skipping clean-conversation-filters
    refined-github.js:4268 ↩️ Skipping bugs-tab
    refined-github.js:4268 ↩️ Skipping quick-review
    refined-github.js:4268 ↩️ Skipping quick-label-removal
    refined-github.js:4268 ↩️ Skipping convert-release-to-draft
    refined-github.js:4268 ↩️ Skipping new-repo-disable-projects-and-wikis
    refined-github.js:4268 ↩️ Skipping quick-repo-deletion
    refined-github.js:4268 ↩️ Skipping list-prs-for-branch
    refined-github.js:4268 ↩️ Skipping clean-repo-tabs
    refined-github.js:4268 ↩️ Skipping pr-base-commit
    refined-github.js:4268 ↩️ Skipping unreleased-commits
    refined-github.js:4268 ↩️ Skipping locked-issue
    refined-github.js:4228 ✅ hide-diff-signs
    refined-github.js:4228 ✅ releases-tab
    refined-github.js:4228 ✅ hide-navigation-hover-highlight
    refined-github.js:4228 ✅ selection-in-new-tab
    refined-github.js:4228 ✅ copy-on-y
    refined-github.js:4228 ✅ profile-hotkey
    refined-github.js:4228 ✅ close-out-of-view-modals
    refined-github.js:4228 ✅ improve-shortcut-help
    refined-github.js:4228 ✅ shorten-links
    refined-github.js:4228 ✅ linkify-code
    refined-github.js:4228 ✅ linkify-branch-references
    refined-github.js:4228 ✅ sort-conversations-by-update-time
    refined-github.js:4228 ✅ ci-link
    refined-github.js:4228 ✅ esc-to-deselect-line
    refined-github.js:4228 ✅ parse-backticks
    refined-github.js:4228 ✅ hide-user-forks
    refined-github.js:4228 ✅ list-prs-for-file
    refined-github.js:4228 ✅ show-whitespace
    refined-github.js:4228 ✅ reload-failed-proxied-images
    refined-github.js:4228 ✅ linkify-user-location
    refined-github.js:4228 ✅ user-local-time
    refined-github.js:4228 ✅ repo-wide-file-finder
    refined-github.js:4228 ✅ clean-repo-filelist-actions
    refined-github.js:4228 ✅ archive-forks-link
    refined-github.js:4228 ✅ easy-toggle-commit-messages
    refined-github.js:4228 ✅ repo-avatars
    refined-github.js:4228 ✅ scrollable-areas
    refined-github.js:4228 ✅ emphasize-draft-pr-label
    refined-github.js:4228 ✅ small-user-avatars
    refined-github.js:4228 ✅ previous-version
    refined-github.js:4228 ✅ mobile-tabs
    refined-github.js:4228 ✅ repo-header-info
    refined-github.js:4228 ✅ visit-tag
    refined-github.js:4228 ✅ click-outside-modal
    refined-github.js:4228 ✅ linkify-symbolic-links
    refined-github.js:4228 ✅ quick-new-issue
    refined-github.js:4228 ✅ more-dropdown-links
    scheduler.production.min.js:1 [Violation] 'message' handler took 181ms
    refined-github.js:4479  Uncaught (in promise) Error: Personal token required for this feature
        at expectToken (refined-github.js:4479:33)
        at async v4uncached (refined-github.js:4524:29)
        at async refined-github.js:4684:19
        at async getSet (refined-github.js:2257:30)
    expectToken @ refined-github.js:4479
    await in expectToken (async)
    add @ refined-github.js:4264
    await in add (async)
    (anonymous) @ refined-github.js:6367
    (anonymous) @ refined-github.js:12741
    (anonymous) @ refined-github.js:12742
    Show 5 more frames
    Show less
    refined-github.js:4479  Uncaught (in promise) Error: Personal token required for this feature
        at expectToken (refined-github.js:4479:33)
        at async v4uncached (refined-github.js:4524:29)
        at async refined-github.js:6485:30
        at async ci_link_add (refined-github.js:6484:22)
    expectToken @ refined-github.js:4479
    await in expectToken (async)
    (anonymous) @ refined-github.js:4721
    Show 2 more frames
    Show less
    refined-github.js:4479  Uncaught (in promise) Error: Personal token required for this feature
        at expectToken (refined-github.js:4479:33)
        at async v4uncached (refined-github.js:4524:29)
        at async refined-github.js:12299:96
        at async previous_version_add (refined-github.js:12298:30)
    expectToken @ refined-github.js:4479
    await in expectToken (async)
    (anonymous) @ refined-github.js:4721
    Show 2 more frames
    Show less
    refined-github.js:4479  Uncaught (in promise) Error: Personal token required for this feature
        at expectToken (refined-github.js:4479:33)
        at async v4uncached (refined-github.js:4524:29)
        at async CachedFunction.updater (refined-github.js:12504:30)
        at async getSet (refined-github.js:2257:30)
    expectToken @ refined-github.js:4479
    await in expectToken (async)
    (anonymous) @ refined-github.js:4721
    Show 2 more frames
    Show less
    refined-github.js:4479  Uncaught (in promise) Error: Personal token required for this feature
        at expectToken (refined-github.js:4479:33)
        at async v4uncached (refined-github.js:4524:29)
        at async CachedFunction.updater (refined-github.js:4981:90)
        at async getSet (refined-github.js:2257:30)
    expectToken @ refined-github.js:4479
    await in expectToken (async)
    (anonymous) @ refined-github.js:4721
    Show 2 more frames
    Show less
    refined-github.js:4479  Uncaught (in promise) Error: Personal token required for this feature
        at expectToken (refined-github.js:4479:33)
        at async v4uncached (refined-github.js:4524:29)
        at async refined-github.js:4684:19
        at async getSet (refined-github.js:2257:30)
    expectToken @ refined-github.js:4479
    await in expectToken (async)
    (anonymous) @ refined-github.js:4721
    Show 2 more frames
    Show less
    

    I used this search to try to find features requiring personal tokens, and then disable them to unclutter the console, but I'm guessing I missed something. Let me know if there's a better search or list to use in future.

    However, the first Personal token required for this feature error references refined-github.js:6367 which is the first line of the block:

        feature_manager.add("file:///home/runner/work/refined-github/refined-github/source/features/default-branch-button.tsx", {
          include: [ isRepoTree, isSingleFile, isRepoCommitListRoot ],
          exclude: [ isDefaultBranch ],
          init: function(signal) {
            observe(branchSelector, default_branch_button_add, {
              signal
            });
          }
        });

    I'll try adding a personal token, see if that makes a difference.

  3. ilike2burnthing commented on Jan 15, 2024

    @ilike2burnthing
    ContributorAuthor

    Yep, personal token was required. Is it supposed to be?

  4. busches commented on Jan 15, 2024

    @busches
    Member

    Yes, anything that uses the v4 API requires it. We'll pull it from the DOM if possible and then fall back to the API for this feature.

  5. ilike2burnthing commented on Jan 15, 2024

    @ilike2burnthing
    ContributorAuthor

    Ok, thanks.

    I'm seeing these in the console for issues:

    refined-github.js:4164 ℹ️ bugs-tab → Personal token required for this feature
    refined-github.js:4164 ℹ️ repo-wide-file-finder → Personal token required for this feature
    refined-github.js:4164 ℹ️ clean-repo-tabs → Personal token required for this feature
    refined-github.js:4164 ℹ️ more-dropdown-links → Personal token required for this feature
    

    However, none of those show up for my previous search.

    Does this search return all features that require a personal token, or is that too broad? I took a stab at dom-chef being a useful identifier.

  6. busches commented on Jan 15, 2024

    @busches
    Member

    Your search only works for features that call the API directly, it misses all features that use a helper that calls the API, e.g. https://github.com/refined-github/refined-github/blob/esbuild-2/source/github-helpers/get-default-branch.ts

  7. ilike2burnthing commented on Jan 15, 2024

    @ilike2burnthing
    ContributorAuthor

    The reason I'm asking for a better search is because the one currently provided by the addon/extension is just for github-helpers api which seems to be out of date then.

    Any improvement?:

    repo:refined-github/refined-github (api.v4 OR expecttoken) path:/^source\/features\//
    
  8. fregante commented on Jan 15, 2024

    @fregante
    Member

    We used to have a dual DOM-or-API approach in many features but this led to all kinds of hard to debug bugs, either because GitHub changed the DOM or because the DOM version got the (wrong) data from an unexpected place.

    So for this reason I started removing all code that does this and instead just rely on the API.

    The token can be read-only so there really isn't any reason not to use it. Refined GitHub never enforced it but I should make it more clear in the options that token-less usage is not supported.

  9. ilike2burnthing commented on Jan 15, 2024

    @ilike2burnthing
    ContributorAuthor

    Another reason I want a more accurate search for affected features is to see just how many I'd be giving up without a token. To be clear, I'll probably just add one as read-only^, but I'm curious.

    ^ so would that just be disabling repo and delete_repo?

    And next question, any way to know which features require which scopes? Only thing I found was expectTokenScope, and that's only applicable for 3 features. If not, could a list be maintained, or commented tags be added at the end of feature files with their required scopes, e.g.:

    // Scopes:  repo  public_repo  repo:status
  10. changed the title [-]`default-branch-button`: no longer working[/-] [+]I did not set the token [/+] on Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions