PHP Symfony's best choice for disable movie - symfony

here is the repo: https://github.com/webostin/sf-case-study/tree/master/movie-invalidator
Short App description
Platform Symfony. We have Movie Entity. We have complex caching system for cache movies pagination and movies itself. We have frontend panel and backend panel.
We have User Entity attached to Movie. We have also Admin Entity.
Problem
We need to soft delete Movie and at the same time reset cache and send email. We have to make it in three (or in future more) contexts:
Frontend User deletes Movie attached to him. Action: soft remove, reset cache, send email to admin;
Admin deletes Movie. Action: soft remove, cache restart, send email to User.
Cron while checking Movie data disables the movie. Action: soft remove, reset cache, send emails to Admin and User
Question
What is the best practise in this specific example. I found 3 solutions: implement everying separetly (not good), write an event subscriber and trigger an event whenever I want to disable Movie, write a service and use Service to disable Movie. It's question for best readable and proper solution. Please provide your solutions if you have any

Mark to delete the movie in the first step. In this case you do not need to unload the cache (you will see a warning message in the interface). In the second step, the administrator confirms the deletion and is added to the queue for cron. the third step is to delete the cron, send e-mail and clear the cache. In this way the entire load rides on the cron.

Related

Symfony - One time message / upcoming maintenance

Just wondering what your thoughts are on the best way to achieve this?
My problem is I want to be able to add new update messages to the top of the website. Eg upcoming maintenance shedules, promoting new features etc. These will be on a random basis whenever I have new information to promote.
I want the message to stay on every page request until the user clicks the dismiss button and then never have it shown again.
My current thinking is either:
Store the messages in a database and then store in cache when user dismisses it so it won't show again. This seems like a waste of a database call though on every page request.
Store in an xml file and load on every request and then store a cookie if user has dismissed that message.
Is there a better way to achieve this or something built into Symfony that can handle this?
Thank you

How do I manually sync a Mesibo profile with latest changes from server if that user published its data with LAZY mode?

I made a page where users can update their names and status just like WhatsApp & Telegram.
These changes are published using LAZY mode since I don't want to update every user using the app right away. I just want to fetch it manually when necessary (for example when the user open the chat view with that user). (https://mesibo.com/documentation/api/real-time-api/profiles/#profile-publishing-mode)
The problem is: how can I fetch the updated profile of other users?
Whenever I get the profiles with Mesibo.getProfile("address") the data is still not updated.
since I don't want to update every user using the app right away.
Even if you use real-time mode, updates don't go to every user but only those users who have subscribed to it.
https://mesibo.com/documentation/api/real-time-api/profiles/#subscribing-to-a-profile
In lazy mode, it may be updated along with other profiles or when the message is received from the users. Before that, getProfile may not return the latest profile.
If you are starting with mesibo, recommend using real-time mode and optimizing later using the lazy mode

How to sync IndexedDB with Firestore?

I am building a job portal for the web using React, Redux and Firebase/Firestore. I've completed all the features I needed except one.
I want unregistered-users/job-seekers to be able to:
Bookmark job posts.
Keep the record of applied jobs.
Keep the record of search queries.
I am thinking about using IndexedDB for this feature. Particularly Dexie.js to make things easier. However, this data will be persisted in user's browser and user will have no access to it in another browser or device. Therefore, I want to give users an option to be able to save all the data to Firestore if user sign into the website and I need this to be automatic. So, as soon as user signs in, I will save it to the database.
I thought about using Anonymous Authentication instead of IndexedDB/Firestore, so all the data will be saved into the database and as soon as user signs in using credentials, the user can claim the ownership of the data. However, this is an extra step to use these features I listed above and not everyone is happy with authenticating an app even though nothing is required from the user. Besides, there will be so many ghost accounts.
So, as I mentioned in the title; I want to save everything to IndexedDB (I will take care of this), but how am I going to synchronize all the data in IndexedDB to Firestore as soon as user signs in?
I imagined the basic process will be like this:
User clicks "Bookmark Job Post"
App checks if users is authenticated or not.
If authenticated, save the bookmark to the Firestore.
If not authenticated, save the bookmark to the IndexedDB.
If User decided to sign in or sign up, check IndexedDB and synchronize it with Firestore and clear IndexedDB.
How can I achieve the 5th step technically? Is there any built in system in Firebase? Also, please feel free to share your idea if you can think of another way implementing this feature. Should I be using firebase.auth().onAuthStateChanged() for the 5th step?
And lastly, how should I structure the Firestore to save bookmarked jobs, applied jobs and search history?
Should I create a bookmarkedJobs collection and have documents of jobPosts duplicated for each user, who bookmarked the job post? And every time a job post is updated by an employer, I will have a cloud function going through bookmarkedJobs collection, updating every instance of it?
Thank you
This may be of interest to you
https://dexie.org/docs/Syncable/Dexie.Syncable.js
Been looking into making my website fully static/pwa, and just using indexeddb, and some webservice for data handling/storage ..this seems like a interesting route to explore.

How to achieve that user is also the author of a task in Phabricator's Maniphest via Conduit API?

The Conduit API in Phabricator does not support setting of authorPHID parameter while calling maniphest.createtask. I can imagine this is because of security or some logical reason.
But I am developping my own frontend for Maniphest where the users (logged through Phabricator, so they are phab users and have phid) will add and edit tasks. What I need is that if a user creates task, he is also the author of the task.
But the problem is, that I can't connect to Conduit as any other user than "apibot" because I don't have others certificates in my front-end to do it. But if I log in as "apibot", then "apibot" is set as an author of the task.
Three possible solutions came to my mind:
1. retrieve certificate directly from phab's database
2. keep a list of certificates in some file in my front-end and update it manually everytime somebody will register
I guess none of them are really smart...
The third solution would be nice, but I didn't find a way, how to do it:
3. log in as "apibot", get certificate of userXY and then log in as the userXY
What would you suggest?

Drupal: user account is limited yet receiving workflow updates?

Is there a way in the Drupal interface to exclude a specific user from workflow status without having to eliminate his account and make a new one?
Looking over his account, he does not have any of the roles to receive status but he does.
Alternatively, I'd rather be able to somehow search for his actual email in the entire system and make sure he is not listed anywhere. Is that even possible in Drupal?
Thanks
I had to just remove his extra account. He had an older account as a admin buried deep in the users.

Resources