Skip to content
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

Bank feeds sdk update #1450

Merged
merged 2 commits into from
Nov 25, 2024
Merged

Bank feeds sdk update #1450

merged 2 commits into from
Nov 25, 2024

Conversation

mcclowes
Copy link
Contributor

Description

  • Include a summary of the new content you're adding or the reason for the change.
  • Include relevant context.
  • Do not link to work items.
  • Any PNG images should be compressed using Tiny PNG or equivalent.

Type of change

Please delete options that are not relevant.

  • New document(s)/updating existing
  • Fixes
  • Styling
  • Bug fix (non-breaking change which fixes an issue)

Reviews and merging

You are responsible for getting your PR merged. Address review comments promptly and make sure to merge the PR when ready.
Feel free to 'Enable automerge' - your PR will automatically merge when accepted and passing the build.

Copy link

vercel bot commented Nov 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
codat-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 25, 2024 0:05am

@mcclowes mcclowes enabled auto-merge November 24, 2024 21:09
Copy link

github-actions bot commented Nov 24, 2024

Overall readability score: 59.3 (🟢 +0.01)

File Readability
241120-onconnectionstarted.md 70.45 (🟢 +0)
241124-bank-feeds-sdk.md 62.66 (-)
View detailed metrics

🟢 - Shows an increase in readability
🔴 - Shows a decrease in readability

File Readability FRE GF ARI CLI DCRS
241120-onconnectionstarted.md 70.45 64.51 10.17 8.7 9.27 7.39
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
241124-bank-feeds-sdk.md 62.66 54.12 10.71 10.9 11.13 7.18
  - - - - - -

Averages:

  Readability FRE GF ARI CLI DCRS
Average 59.3 49.95 10.19 11.32 11.89 7.77
  🟢 +0.01 🟢 +0.01 🟢 +0 🟢 +0 🟢 +0 🟢 +0
View metric targets
Metric Range Ideal score
Flesch Reading Ease 100 (very easy read) to 0 (extremely difficult read) 60
Gunning Fog 6 (very easy read) to 17 (extremely difficult read) 8 or less
Auto. Read. Index 6 (very easy read) to 14 (extremely difficult read) 8 or less
Coleman Liau Index 6 (very easy read) to 17 (extremely difficult read) 8 or less
Dale-Chall Readability 4.9 (very easy read) to 9.9 (extremely difficult read) 6.9 or less

@mcclowes
Copy link
Contributor Author

ChatGPT's code review:

Code Review

  1. Clarity:

    • The code structure is clear and well-organized.
    • Variable and function names are descriptive, enhancing readability.
    • The use of React functional components and hooks improves code clarity and maintainability.
  2. Efficiency:

    • The code appears efficient in terms of component rendering and SDK initialization.
    • Consider optimizing the useEffect dependency array to avoid unnecessary re-renders by specifying exact dependencies.
  3. Best Practices:

    • Follows React best practices for functional components and hooks usage.
    • The code leverages external SDKs and libraries effectively.
    • Consider providing more detailed documentation or comments for complex logic or SDK integration steps.
  4. Bugs/Security:

    • No apparent security vulnerabilities in the provided code snippet.
    • Ensure that sensitive data like access tokens are handled securely, especially in client-side code.
  5. Maintainability:

    • The code is maintainable due to its modular structure and separation of concerns.
    • Consider adding error handling mechanisms to gracefully handle SDK initialization or API call failures.

Suggestions for Improvement

  1. Optimize useEffect Dependency Array:

    • Update the useEffect dependency array to include only necessary dependencies to avoid unnecessary re-renders. For example:
      useEffect(() => {
        const target = componentMount;
        if (target && target.children.length === 0) {
          initializeCodatBankFeeds(target, props);
        }
        // eslint-disable-next-line react-hooks/exhaustive-deps
      }, [componentMount, props]); // Specify props as a dependency if required
  2. Enhance Error Handling:

    • Implement error handling mechanisms within the CodatBankFeeds component to handle potential SDK initialization errors or API call failures. For example, display an error message to the user if initialization fails.
  3. Secure Access Token Handling:

    • Ensure that sensitive data like access tokens are not hard-coded in the client-side code. Consider using environment variables or secure storage mechanisms to handle access tokens securely.
  4. Documentation and Comments:

    • Provide detailed documentation or comments within the code to explain complex SDK integration steps or callback functions. This will aid in understanding and maintaining the code in the future.

Overall, the code demonstrates good practices in React development. By addressing the suggested improvements, you can enhance the efficiency, maintainability, and security of the component integration with the Bank Feeds SDK.

@mcclowes mcclowes merged commit 40b1f5e into main Nov 25, 2024
5 checks passed
@mcclowes mcclowes deleted the feat/bank-feeds-sdk-update branch November 25, 2024 12:08
Copy link

Link check results (filtered):

[]

@@ -23,6 +23,6 @@ All clients using Link SDK to deploy the auth flow in their application.

## How to get started?

To implement an auth flow with our Link SDK, see [Get started with Link SDK](https://docs.codat.io/auth-flow/authorize-embedded-link).
To implement an auth flow with our Link SDK, see [Get started with Link SDK](/auth-flow/authorize-embedded-link).
Copy link
Contributor

Choose a reason for hiding this comment

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

How does the code know the main domain if not included here then?

Copy link
Contributor Author

@mcclowes mcclowes Nov 25, 2024

Choose a reason for hiding this comment

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

The code treats it as relative to the domain the site is hosted at.

If you hard code the domain, it won't work in staging/preview environments, etc.

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.

3 participants