-
Notifications
You must be signed in to change notification settings - Fork 0
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
upate workspace last synced fix #320
Conversation
WalkthroughThe recent update streamlines the codebase by refining import statements and enhancing conditional logic related to synchronization timestamps. These adjustments aim to improve efficiency and clarity, ensuring that the application remains responsive and up-to-date with the latest data. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -103,7 +101,7 @@ def async_create_expense_groups( | |||
) | |||
) | |||
|
|||
if expenses: | |||
if workspace.last_synced_at or expenses: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for updating workspace.last_synced_at
is now based on whether this timestamp is already set or if there are any expenses. This change ensures that the timestamp is updated to the current time if either condition is met. However, it's important to ensure that this logic aligns with the intended behavior for all scenarios where expenses might be processed. Consider adding a comment explaining the rationale behind this condition to aid future maintainers.
@@ -126,7 +124,7 @@ def async_create_expense_groups( | |||
) | |||
) | |||
|
|||
if len(expenses) != reimbursable_expenses_count: | |||
if workspace.ccc_last_synced_at or len(expenses) != reimbursable_expenses_count: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the previous comment, the update to workspace.ccc_last_synced_at
is now contingent upon the timestamp being set or the number of expenses differing from the count of reimbursable expenses. This adjustment seems to target a more accurate update mechanism for credit card transactions. As with the previous suggestion, adding explanatory comments could enhance maintainability.
from typing import Dict, List | ||
|
||
from django.db import transaction | ||
from fyle.platform.exceptions import ( | ||
InvalidTokenError as FyleInvalidTokenError, | ||
RetryException, | ||
) | ||
from fyle.platform.exceptions import InvalidTokenError as FyleInvalidTokenError | ||
from fyle.platform.exceptions import RetryException | ||
from fyle_integrations_platform_connector import PlatformConnector | ||
|
||
from apps.fyle.actions import create_generator_and_post_in_batches |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [143-143]
Logging sensitive information, such as workspace IDs, could potentially expose them in logs which might not be secure. While the logged message "Fyle credentials not found %s" is not directly logging sensitive information, it's a good practice to review what is being logged and ensure that no sensitive data is inadvertently exposed. Consider revising the logging strategy to minimize the risk of exposing sensitive information.
- logger.info("Fyle credentials not found %s", workspace_id)
+ logger.info("Fyle credentials not found for workspace ID: [REDACTED]")
|
1 similar comment
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #320 +/- ##
=======================================
Coverage 94.53% 94.54%
=======================================
Files 60 60
Lines 3626 3627 +1
=======================================
+ Hits 3428 3429 +1
Misses 198 198 ☔ View full report in Codecov by Sentry. |
* Added integrations_imports submodule, made changes in settings (#310) * Refactor imports for Project resource (#311) * Added integrations_imports submodule, made changes in settings * Resource Project: Added new flow for the Project Import * Typo Fix * Resource Project: removed old import logic for Project * Resource Project: added cluster import, fixed minor typo, added new supplier field * Refactor imports for project and cost_center (#314) * Added integrations_imports submodule, made changes in settings * Resource Project: Added new flow for the Project Import * Typo Fix * Resource Project: removed old import logic for Project * Resource Project: added cluster import, fixed minor typo, added new supplier field * Refactor imports costcenter (#312) * Resource Cost_Center: refactored imports * Refactor imports for Project resource (#311) * Added integrations_imports submodule, made changes in settings * Resource Project: Added new flow for the Project Import * Typo Fix * Resource Project: removed old import logic for Project * Resource Project: added cluster import, fixed minor typo, added new supplier field * Refactor imports custom expense (#313) * Added integrations_imports submodule, made changes in settings * Resource Project: Added new flow for the Project Import * Typo Fix * Resource Project: removed old import logic for Project * Resource Cost_Center: refactored imports * Resource Custom Expense Field: refactored imports * Resource Project: added cluster import, fixed minor typo, added new supplier field * Resource Tax Group: refactored imports (#315) * Added integrations_imports submodule, made changes in settings * Resource Project: Added new flow for the Project Import * Typo Fix * Resource Project: removed old import logic for Project * Resource Cost_Center: refactored imports * Resource Custom Expense Field: refactored imports * Resource Project: added cluster import, fixed minor typo, added new supplier field * Resource Tax Group: refactored imports * Resource Tax Group: changed to is_auto_sync to False by default * Resource Category: refactored imports (#316) * Added integrations_imports submodule, made changes in settings * Resource Project: Added new flow for the Project Import * Typo Fix * Resource Project: removed old import logic for Project * Resource Cost_Center: refactored imports * Resource Custom Expense Field: refactored imports * Resource Tax Group: refactored imports * Resource Category: refactored imports * Resource Category: changed is_auto_sync_enabled to True by default * Refactor imports supplier (#318) * Added integrations_imports submodule, made changes in settings * Resource Project: Added new flow for the Project Import * Typo Fix * Resource Project: removed old import logic for Project * Resource Cost_Center: refactored imports * Resource Custom Expense Field: refactored imports * Resource Tax Group: refactored imports * Resource Category: refactored imports * Added RetryException handler and bumped the sdk versions (#306) * Set tasks limit to 1L (#317) * Set tasks limit to 1L * set timeout * Modified the import schedule creation condition --------- Co-authored-by: ruuushhh <[email protected]> * Refactor old flow (#321) * Added integrations_imports submodule, made changes in settings * Resource Project: Added new flow for the Project Import * Typo Fix * Resource Project: removed old import logic for Project * Resource Cost_Center: refactored imports * Resource Custom Expense Field: refactored imports * Resource Tax Group: refactored imports * Resource Category: refactored imports * Added RetryException handler and bumped the sdk versions (#306) * Set tasks limit to 1L (#317) * Set tasks limit to 1L * set timeout * Modified the import schedule creation condition * Removed dead code, add few test cases, added script for adding new schedule for different workspaces * Added post deploy sql script to dump old schedules and delete --------- Co-authored-by: ruuushhh <[email protected]> * Merged changes from master * Update delete workspace func (#319) * Update delete workspace func * Fix comments * upate workspace last synced fix (#320) * Modified the workflow for submodule * Decreased the coverage to 88% --------- Co-authored-by: ruuushhh <[email protected]>
Summary by CodeRabbit