Skip to content

[WIP] Enhance Cryptocurrency Details Service with Improved Error Handling and Caching#169

Draft
Vuk7912 wants to merge 5 commits into
HermanKoii:mainfrom
Vuk7912:29164f19-ce10-4f02-85c0-9568a4a29675-merged
Draft

[WIP] Enhance Cryptocurrency Details Service with Improved Error Handling and Caching#169
Vuk7912 wants to merge 5 commits into
HermanKoii:mainfrom
Vuk7912:29164f19-ce10-4f02-85c0-9568a4a29675-merged

Conversation

@Vuk7912
Copy link
Copy Markdown

@Vuk7912 Vuk7912 commented Jun 7, 2025

Enhance Cryptocurrency Details Service with Improved Error Handling and Caching

Description

Summary of Work

This pull request introduces improvements to the cryptocurrency details service, focusing on:

  1. Robust error handling for coin detail retrieval
  2. Implementing a caching mechanism using node-cache
  3. Providing a structured approach to managing mock cryptocurrency data

Key Improvements:

  • Added input validation for coin IDs
  • Implemented a 10-minute cache for coin details
  • Created a comprehensive error handling middleware
  • Structured mock data for easy extension

Future Considerations:

  • Replace mock data with real-time cryptocurrency API integration
  • Add more comprehensive test coverage
  • Implement more advanced caching strategies

Changes Made

  • Added input validation function validateCoinId()
  • Implemented error handling middleware coinDetailsErrorHandler()
  • Created a 10-minute cache using node-cache
  • Structured mock coin data with consistent properties
  • Added normalization of coin IDs to lowercase
  • Implemented caching logic in getCoinDetails() function

Tests and Verification

  • Manual testing of coin details retrieval
  • Verified error handling for:
    • Missing coin ID
    • Non-existent coin ID
  • Confirmed caching mechanism works as expected
  • Validated input validation logic

PRs Merged

The following pull requests have been merged:

Signatures

Staking Key

3oBzgQ4y8YtmkxYGkse1fKKefi25twpMKU9BBdsYtjDQ: 2rZPbKuroBGZXLYm6m1xt4Hn7JDUtGwsJ7tj8oWp1VXaqSt89eG3GBJdsdN2eMdXgDho4L8TFV8275yhdL7MZ6Xv8VeLX7jPV4tSBLDG4Kf4rA5M2Fq6BNJDi7pPhxnZK3mAZcpErpdGmo5yUpGJRjkb2ca6zyd9sXJy2LdDnAvscRtLsdUfzTKoMkUhpAQit3j68r1B5qFZZLQg8QqrPS92CVhwpiCamanJ3XEcTtrprwpS7j9gtQVBoQ9YXbuEeyVuLP99ZXUQBxmF7GmFfeNgCZgu2nZCa2P4LxZyzwWdedFknwdcWmRhbQ7kNMArhQiNDWW6c5xUvw53kPRyUWmk2ejPNqkrLWpKHMZFHc4MfNjyB5JaX83Haayi8GfY6ahfAAGfsUF2nC1TVDWvAknGmQksqUVS

Public Key

4WA5vRJLthsg6sJqVc6DQuRkGzvoxZ11SkqzwbqxCo2V: xpCypxcTRMXdar35YDTMR3dGwxY8CbKVpxnGYjotYpZRjiKjM2YgiYkTty8DVmBvsaXDv1hs6rraWPbCA5B5aqEiWUT1Zjnrt1TiaVBrjh8eGR8HvHkkPB5NKYsgGUc1FAhRBBFLJ9iSNtAPQzkLHgqankJ8DAVjCt5FWucv8i8X5ddsMqwQhFUAUqhat1KJ5nm1F3gbQVkNCWDRik4EuLScPJ6J6CTVcfrNGjy5Y5BgzFjpLVp5bitamkRpDZr8YxWyve3cwVTZ7fzKwDJLTRdHypaZmJxapJsW162pCMjb6mK47fjBYg7wXGunB8Mpix6NoSfJrqtE91AgcHgZkCB5qXBvfKUWmWKaoEF7cphLBS2hSphR25dui89DdQcdE1bLBbDR3pLxL6mRLZswQtDxeAHLGmJ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants