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

feat: soft delete #642

Merged
merged 4 commits into from
Apr 26, 2022
Merged

feat: soft delete #642

merged 4 commits into from
Apr 26, 2022

Conversation

arnaudambro
Copy link
Contributor

@arnaudambro arnaudambro commented Apr 25, 2022

TODO

Avec ce code qu'on envoie, on a toujours des éléments supprimés dans l'app qui ne devraient pas être là.
Solution simple et utile pour l'avenir: gérer les versions de cache (je pense ? qu'en penses-tu ?)
Je voulais faire une chose simple mais ça marchait pas, donc je ne l'ai pas encore fait
Je pense surtout qu'on aurait intérêt à changer de lib MMKV pour aller vers une plus populaire et plus simple d'utilisation, et potentiellement qui marche mieux: https://github.com/mrousavy/react-native-mmkv (voir: How is this library different from another mmkv?)

@arnaudambro arnaudambro requested a review from rap2hpoutre April 25, 2022 12:45
@github-actions github-actions bot temporarily deployed to mano-feat-soft-delete-569crm April 25, 2022 12:46 Inactive
@github-actions github-actions bot temporarily deployed to mano-feat-soft-delete-569crm April 25, 2022 13:26 Inactive
@arnaudambro
Copy link
Contributor Author

changé !

    if (updatedAfter && deletedAfter) {
       query.where[Op.or] = [{ updatedAt: { [Op.gte]: new Date(Number(updatedAfter)) } }, { deletedAt: { [Op.gte]: new Date(Number(deletedAfter)) } }];
       query.paranoid = false;
     }

@@ -55,7 +55,7 @@ const mergeItems = (oldItems, newItems) => {

const Loader = () => {
const [picture, setPicture] = useState([picture1, picture3, picture2][randomIntFromInterval(0, 2)]);
const [lastRefresh, setLastRefresh] = useStorage('last-refresh', 0);
const [lastRefresh, setLastRefresh] = useStorage('last-refresh--cache-version-2022-04-25', 0);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

j'en ai profité aussi pour régler le problème de cache sans toucher à MMKV

@github-actions github-actions bot temporarily deployed to mano-feat-soft-delete-569crm April 25, 2022 14:47 Inactive
Copy link
Member

@rap2hpoutre rap2hpoutre left a comment

Choose a reason for hiding this comment

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

Je me déteste, voir commentaire plus bas

api/src/controllers/action.js Outdated Show resolved Hide resolved
@github-actions github-actions bot temporarily deployed to mano-feat-soft-delete-569crm April 25, 2022 16:09 Inactive
@arnaudambro arnaudambro requested a review from rap2hpoutre April 25, 2022 16:16
@github-actions github-actions bot temporarily deployed to mano-feat-soft-delete-569crm April 25, 2022 16:16 Inactive
Copy link
Member

@rap2hpoutre rap2hpoutre left a comment

Choose a reason for hiding this comment

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

C'est bon

@github-actions
Copy link

🎉 Deployment for commit d3c5122 :

Ingresses
Docker images
  • 📦 docker pull ghcr.io/socialgouv/docker/wait-for-postgres:6.56.1
  • 📦 docker pull ghcr.io/socialgouv/mano/api:sha-d3c5122cd0dfac2dea727183381c3cbc5f0c87c3
  • 📦 docker pull ghcr.io/socialgouv/mano/dashboard:sha-d3c5122cd0dfac2dea727183381c3cbc5f0c87c3
  • 📦 docker pull ghcr.io/socialgouv/mano/website:sha-d3c5122cd0dfac2dea727183381c3cbc5f0c87c3
Debug

@sonarcloud
Copy link

sonarcloud bot commented Apr 26, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
49.2% 49.2% Duplication

@arnaudambro arnaudambro merged commit 2998209 into main Apr 26, 2022
@arnaudambro arnaudambro deleted the feat--soft-delete branch April 26, 2022 08:32
SocialGroovyBot added a commit that referenced this pull request Apr 26, 2022
# [1.95.0](v1.94.8...v1.95.0) (2022-04-26)

### Features

* soft delete ([#642](#642)) ([2998209](2998209))
@SocialGroovyBot
Copy link
Member

🎉 This PR is included in version 1.95.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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