bcwaters / MinusMail

Temporary email available in your browser
0 stars 0 forks source link

Email Persistence #4

Open bcwaters opened 5 years ago

bcwaters commented 5 years ago

At the moment the user only receives emails while they are connected to the site. Any email received before or after cannot be received by them.

Determine a timeframe and implement a way to retrieve emails for a user within that period. the simplest way I can think of is like this: set up a directory structure where email gets it's own directory

--/tmp/emails/ ---------------/emailaddress1 ---------------/emailaddress2

Using fs whenever the client emits an updated email load all the files in that directory as mailobjects and emit result back over the socket. *It might be handy to read the age of each file and if they exceed the thresh hold then delete them and skip parsing and sending.

bcwaters commented 5 years ago

MongoDB has been added for email persistence... but this is a pandoras box of issues.

--Upon changing session emit persistence emails to client to load into the inbox

--Refactor inbox to have a seperated state for persistence emails otherwise their inbox fills up each time a new user joins the same room

--When a user changes rooms clear the inbox array

--after an item is added to the db delete the file