Skip to content

Conversation

@QiyuanHananu
Copy link
Collaborator

🎯 Task 3.2: INSPIRE API Optimization

📋 What this PR does

  • Implements retry mechanism with 3 attempts and exponential backoff
  • Adds connection timeout configuration (10 seconds)
  • Enhances logging with INFO/WARN/DEBUG levels
  • Adds comprehensive result validation
  • Integrates with 3.1 task (texkeys extraction)

🔧 Technical Changes

  • Retry Logic: 3 attempts with 1s → 2s → 4s delays
  • Timeout: 10s connection timeout to prevent hanging
  • Logging: Detailed logs for debugging and monitoring
  • Validation: Checks citation key quality and required fields
  • Integration: Works seamlessly with existing texkeys extraction

📊 Code Stats

  • Files changed: 1 (INSPIREFetcher.java)
  • Lines added: +181
  • Lines removed: -10
  • Net change: +171 lines

🎯 Resolves

Part of issue JabRef#12292 - Task 3.2: INSPIRE API optimization

- Implement retry mechanism with 3 attempts and exponential backoff
- Add timeout configuration (10s connect, 30s read)
- Add comprehensive logging (INFO/WARN/DEBUG levels)
- Add citation key validation to detect URL-like keys
- Improve error messages with actionable suggestions
- Add test guide for validation

Part of issue JabRef#12292 - Task 3.2: INSPIRE API optimization
Provides stable data source for other team members' tasks
- Integrated Sonia's 3.1 task (texkeys extraction and key cleanup)
- Kept retry mechanism and validation from 3.2 task
- Combined both features for complete INSPIRE fetcher improvement
- Removed test documentation file
- Import java.time.Duration for timeout settings
- Use Duration.ofMillis() for setConnectTimeout (URLDownload only supports connect timeout)
- Remove setReadTimeout (not supported by URLDownload class)
- Change catch block to ParseException | FetcherException (IOException not thrown)
- Code now compiles successfully
@QiyuanHananu QiyuanHananu requested a review from AmandaDec October 9, 2025 04:09
@QiyuanHananu QiyuanHananu self-assigned this Oct 9, 2025
@QiyuanHananu QiyuanHananu added the enhancement New feature or request label Oct 9, 2025
Copy link
Collaborator

@AmandaDec AmandaDec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good.

@QiyuanHananu QiyuanHananu merged commit bc84296 into main Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants