Skip to content

Commit 2fea457

Browse files
Merge branch 'main' into bkellam/repos-pagination
2 parents cf35d04 + f1b4361 commit 2fea457

8 files changed

Lines changed: 37 additions & 21 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2222
- Renamed `webUrl` to `externalWebUrl` for various apis. Moving forward, `webUrl` will be used for URLs that point to Sourcebot, and `externalWebUrl` will be used for URLs that point to external code hosts. [#795](https://github.com/sourcebot-dev/sourcebot/pull/795)
2323
- Renamed various fields on the `/api/source` endpoint response body. [#795](https://github.com/sourcebot-dev/sourcebot/pull/795)
2424

25+
### Fixed
26+
- Fixed issue where a file would fail to load when opening it from the /search view and it matched multiple branches. [#797](https://github.com/sourcebot-dev/sourcebot/pull/797)
27+
- [EE] Fixed GitLab OAuth token refresh failures by including the required `redirect_uri` parameter. [#798](https://github.com/sourcebot-dev/sourcebot/pull/798)
28+
2529
## [4.10.17] - 2026-01-23
2630

2731
### Fixed

packages/web/src/app/[domain]/browse/[...path]/components/codePreviewPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const CodePreviewPanel = async ({ path, repoName, revisionName }: CodePre
5353
displayName: repoInfoResponse.displayName,
5454
externalWebUrl: repoInfoResponse.externalWebUrl,
5555
}}
56-
branchDisplayName={revisionName}
56+
revisionName={revisionName}
5757
/>
5858

5959
{fileWebUrl && (

packages/web/src/app/[domain]/browse/[...path]/components/treePreviewPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const TreePreviewPanel = async ({ path, repoName, revisionName }: TreePre
3939
}}
4040
pathType="tree"
4141
isFileIconVisible={false}
42-
branchDisplayName={revisionName}
42+
revisionName={revisionName}
4343
/>
4444
</div>
4545
<Separator />

packages/web/src/app/[domain]/components/pathHeader.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ interface FileHeaderProps {
3333
},
3434
isBranchDisplayNameVisible?: boolean;
3535
branchDisplayName?: string;
36+
revisionName?: string;
3637
branchDisplayTitle?: string;
3738
isCodeHostIconVisible?: boolean;
3839
isFileIconVisible?: boolean;
@@ -53,7 +54,8 @@ export const PathHeader = ({
5354
repo,
5455
path,
5556
pathHighlightRange,
56-
branchDisplayName,
57+
revisionName,
58+
branchDisplayName = revisionName,
5759
isBranchDisplayNameVisible = !!branchDisplayName,
5860
branchDisplayTitle,
5961
pathType = 'blob',
@@ -220,7 +222,7 @@ export const PathHeader = ({
220222
repoName: repo.name,
221223
path: '/',
222224
pathType: 'tree',
223-
revisionName: branchDisplayName,
225+
revisionName,
224226
domain,
225227
})}
226228
>
@@ -259,7 +261,7 @@ export const PathHeader = ({
259261
repoName: repo.name,
260262
path: segment.fullPath,
261263
pathType: segment.isLastSegment ? pathType : 'tree',
262-
revisionName: branchDisplayName,
264+
revisionName,
263265
domain,
264266
})}
265267
className="font-mono text-sm hover:cursor cursor-pointer"
@@ -288,7 +290,7 @@ export const PathHeader = ({
288290
repoName: repo.name,
289291
path: segment.fullPath,
290292
pathType: segment.isLastSegment ? pathType : 'tree',
291-
revisionName: branchDisplayName,
293+
revisionName,
292294
domain,
293295
})}
294296
>

packages/web/src/app/[domain]/search/components/searchResultsPanel/fileMatchContainer.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ export const FileMatchContainer = ({
6969
return file.branches;
7070
}, [file.branches]);
7171

72-
const branchDisplayName = useMemo(() => {
73-
if (branches.length === 0) {
74-
return undefined;
75-
}
76-
77-
return `${branches[0]}${branches.length > 1 ? ` +${branches.length - 1}` : ''}`;
72+
const revisionName = useMemo(() => {
73+
return branches.length > 0 ? branches[0] : undefined;
7874
}, [branches]);
7975

76+
const branchDisplayName = useMemo(() => {
77+
return revisionName ? `${revisionName}${branches.length > 1 ? ` +${branches.length - 1}` : ''}` : undefined;
78+
}, [branches.length, revisionName]);
79+
8080
const repo = useMemo(() => {
8181
return repoInfo[file.repositoryId];
8282
}, [repoInfo, file.repositoryId]);
@@ -99,8 +99,9 @@ export const FileMatchContainer = ({
9999
}}
100100
path={file.fileName.text}
101101
pathHighlightRange={fileNameRange}
102-
isBranchDisplayNameVisible={isBranchFilteringEnabled}
102+
revisionName={revisionName}
103103
branchDisplayName={branchDisplayName}
104+
isBranchDisplayNameVisible={isBranchFilteringEnabled}
104105
branchDisplayTitle={branches.join(", ")}
105106
/>
106107
<Button

packages/web/src/ee/features/codeNav/components/exploreMenu/referenceList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export const ReferenceList = ({
9898
externalWebUrl: repoInfo.webUrl,
9999
}}
100100
path={file.fileName}
101-
branchDisplayName={revisionName === "HEAD" ? undefined : revisionName}
101+
revisionName={revisionName === "HEAD" ? undefined : revisionName}
102102
/>
103103
</div>
104104
<div className="divide-y">

packages/web/src/ee/features/permissionSyncing/tokenRefresh.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,18 +119,27 @@ export async function refreshOAuthToken(
119119
continue;
120120
}
121121

122+
// Build request body parameters
123+
const bodyParams: Record<string, string> = {
124+
client_id: clientId,
125+
client_secret: clientSecret,
126+
grant_type: 'refresh_token',
127+
refresh_token: refreshToken,
128+
};
129+
130+
// GitLab requires redirect_uri to match the original authorization request
131+
// even when refreshing tokens. Use URL constructor to handle trailing slashes.
132+
if (provider === 'gitlab') {
133+
bodyParams.redirect_uri = new URL('/api/auth/callback/gitlab', env.AUTH_URL).toString();
134+
}
135+
122136
const response = await fetch(url, {
123137
method: 'POST',
124138
headers: {
125139
'Content-Type': 'application/x-www-form-urlencoded',
126140
'Accept': 'application/json',
127141
},
128-
body: new URLSearchParams({
129-
client_id: clientId,
130-
client_secret: clientSecret,
131-
grant_type: 'refresh_token',
132-
refresh_token: refreshToken,
133-
}),
142+
body: new URLSearchParams(bodyParams),
134143
});
135144

136145
if (!response.ok) {

packages/web/src/features/chat/components/chatThread/referencedFileSourceListItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ const ReferencedFileSourceListItem = ({
231231
displayName: repoDisplayName,
232232
externalWebUrl: repoWebUrl,
233233
}}
234-
branchDisplayName={revision === 'HEAD' ? undefined : revision}
234+
revisionName={revision === 'HEAD' ? undefined : revision}
235235
repoNameClassName="font-normal text-muted-foreground text-sm"
236236
/>
237237
</div>

0 commit comments

Comments
 (0)