commits
Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>
Feat/remove note
This reverts commit d3e68863b6d507f042db72cf8ecfa2a6f7733025.
This reverts commit 7b3d6f421b0df7deeda4d3e1f4d45deca30da4ea.
This reverts commit 89d51b600b6ad4ececa052c88552ca1e227e92c6.
This reverts commit ae0a7fd813f58cb0f045277f736411126044dcc7.
Feat/add to semble
The key improvements are:
1. PWA detection mechanism
2. Fallback cookie handling for PWA context
3. Extended Safari iOS delay
4. PWA-specific logout handling
The only remaining piece is the backend `CookieService.ts` to set `httpOnly: false` and `secure: true` always. Could you share that file so I can suggest the final backend changes?
Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>
Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>
Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>
Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>
Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>
Fix/temp auth fix
1. Detecting concurrent refresh attempts
2. Ensuring only one request proceeds
3. Sharing the result with all waiting callers
4. Properly resetting state after completion
A few additional recommendations:
## Optional Enhancements
### 1. Add Error Handling
```typescript
export const verifySessionOnClient = cache(
async (): Promise<GetProfileResponse | null> => {
if (isRefreshing && refreshPromise) {
try {
return await refreshPromise;
} catch {
// If previous refresh failed, allow a new attempt
isRefreshing = false;
refreshPromise = null;
}
}
// Rest of the implementation remains the same
}
);
```
### 2. Consider Timeout
```typescript
export const verifySessionOnClient = cache(
async (): Promise<GetProfileResponse | null> => {
const MAX_WAIT_TIME = 10000; // 10 seconds
if (isRefreshing && refreshPromise) {
try {
return await Promise.race([
refreshPromise,
new Promise<null>((_, reject) =>
setTimeout(() => reject(new Error('Auth refresh timeout')), MAX_WAIT_TIME)
)
]);
} catch {
isRefreshing = false;
refreshPromise = null;
}
}
// Rest of the implementation remains the same
}
);
```
These are optional and depend on your specific requirements. The current implementation is solid and should resolve the race condition issues.
Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>
Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>
Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>
Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>
Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>
Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>
Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>
Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>
Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>
Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>
1. Race condition prevention with `refreshPromise`
2. Mutex-based token refresh
3. Graceful error handling
4. Automatic retry on 401 errors
A few quick recommendations for follow-up:
1. **Logging**: Consider adding more detailed logging for token refresh failures
2. **Error Tracking**: Integrate with your error tracking service (Sentry, etc.)
3. **Refresh Token Rotation**: Ensure your backend supports token rotation
Would you like me to elaborate on any of these points or help you implement additional improvements?
Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>
The key improvements are:
1. PWA detection mechanism
2. Fallback cookie handling for PWA context
3. Extended Safari iOS delay
4. PWA-specific logout handling
The only remaining piece is the backend `CookieService.ts` to set `httpOnly: false` and `secure: true` always. Could you share that file so I can suggest the final backend changes?
Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>
1. Detecting concurrent refresh attempts
2. Ensuring only one request proceeds
3. Sharing the result with all waiting callers
4. Properly resetting state after completion
A few additional recommendations:
## Optional Enhancements
### 1. Add Error Handling
```typescript
export const verifySessionOnClient = cache(
async (): Promise<GetProfileResponse | null> => {
if (isRefreshing && refreshPromise) {
try {
return await refreshPromise;
} catch {
// If previous refresh failed, allow a new attempt
isRefreshing = false;
refreshPromise = null;
}
}
// Rest of the implementation remains the same
}
);
```
### 2. Consider Timeout
```typescript
export const verifySessionOnClient = cache(
async (): Promise<GetProfileResponse | null> => {
const MAX_WAIT_TIME = 10000; // 10 seconds
if (isRefreshing && refreshPromise) {
try {
return await Promise.race([
refreshPromise,
new Promise<null>((_, reject) =>
setTimeout(() => reject(new Error('Auth refresh timeout')), MAX_WAIT_TIME)
)
]);
} catch {
isRefreshing = false;
refreshPromise = null;
}
}
// Rest of the implementation remains the same
}
);
```
These are optional and depend on your specific requirements. The current implementation is solid and should resolve the race condition issues.
Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>
1. Race condition prevention with `refreshPromise`
2. Mutex-based token refresh
3. Graceful error handling
4. Automatic retry on 401 errors
A few quick recommendations for follow-up:
1. **Logging**: Consider adding more detailed logging for token refresh failures
2. **Error Tracking**: Integrate with your error tracking service (Sentry, etc.)
3. **Refresh Token Rotation**: Ensure your backend supports token rotation
Would you like me to elaborate on any of these points or help you implement additional improvements?
Co-authored-by: aider (anthropic/claude-sonnet-4-20250514) <aider@aider.chat>