Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix Templates page infinite loading by adding error handling to API calls #3252

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

Open
Copilot wants to merge 2 commits into develop
base: develop
Choose a base branch
Loading
from copilot/fix-3245

Conversation

Copy link
Contributor

@Copilot Copilot AI commented Aug 30, 2025
edited
Loading

The Task Templates page would get stuck in an infinite loading state when any of the required API calls failed. This happened because the page uses Promise.all() to load multiple resources in parallel (inventory, environment, repositories, views, apps), and if any single call failed, the entire loading process would hang.

Root Cause

The Templates page loading logic had no error handling:

// Before - any failure blocks the entire page
[
 this.inventory,
 this.environment, 
 this.repositories,
] = await Promise.all([
 this.loadProjectResources('inventory'),
 this.loadProjectResources('environment'),
 this.loadProjectResources('repositories'),
]);

When users created SSH keys, repositories, and inventories, certain API endpoints might fail due to permissions, network issues, or server errors, causing the page to remain in loading state indefinitely.

Solution

Added comprehensive error handling to ensure the page can render even when some API calls fail:

// After - independent error handling with fallbacks
[
 this.inventory,
 this.environment,
 this.repositories,
] = await Promise.all([
 this.loadProjectResources('inventory').catch((err) => {
 console.error('Failed to load inventory:', err);
 return [];
 }),
 this.loadProjectResources('environment').catch((err) => {
 console.error('Failed to load environment:', err);
 return [];
 }),
 this.loadProjectResources('repositories').catch((err) => {
 console.error('Failed to load repositories:', err);
 return [];
 }),
]);

Changes Made

  • Templates.vue: Added error handling to loadData() and loadViews() methods
  • ItemListPageBase.js: Added error handling to loadItems() method used by Templates
  • AppsMixin.js: Added error handling to apps data loading
  • Each failed API call now returns an empty array instead of blocking the page
  • Added console error logging to help diagnose API failures

The page will now load successfully with available data even when some resources fail to load, resolving the infinite loading issue.

Fixes #3245.


💬 Share your feedback on Copilot coding agent for the chance to win a 200ドル gift card! Click here to start the survey.

chatgpt-codex-connector[bot] reacted with thumbs up emoji
- Add try-catch blocks to Templates.vue loadData() and loadViews() methods
- Add error handling to ItemListPageBase.js loadItems() method
- Add error handling to AppsMixin.js for apps data loading
- Ensure page can render with empty arrays when API calls fail
- Add console error logging to help diagnose future issues
Co-authored-by: fiftin <914224+fiftin@users.noreply.github.com>
@Copilot Copilot AI changed the title (削除) [WIP] Problem: Page "Task Templates" doesnt load (削除ここまで) (追記) Fix Templates page infinite loading by adding error handling to API calls (追記ここまで) Aug 30, 2025
@Copilot Copilot AI requested a review from fiftin August 30, 2025 14:30
Copilot finished work on behalf of fiftin August 30, 2025 14:30
@fiftin fiftin marked this pull request as ready for review August 30, 2025 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@fiftin fiftin Awaiting requested review from fiftin

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Problem: Page "Task Templates" doesnt load

2 participants

AltStyle によって変換されたページ (->オリジナル) /