Skip to content

Conversation

@lazaronixon
Copy link
Owner

Domain model

Here's what happens when a user uploads a "vcr" file:

  • An Import is created, which triggers a process_file on a background job.
  • Import::Processor is called, it's responsible for creating Contact and Import::SkippedContact.
  • Import has its status changed from processing to (failed, processed, or no_new_contacts).
  • Import invokes broadcast_refresh_later, updating the importing page to the correct state.
  • When an Import is destroyed, all the associated contacts are deleted asynchronously.

Actions

  • An import can be created using POST /contacts/imports.
  • An import can be undone using DELETE /contacts/import/{id}.
  • Import status can be tracked at GET /contacts/import/{id}/edit.
  • We can see import details at GET /contacts/import/{id}.

Highlights

  • Import implements "command object" through Import::Processor.
  • The processing page is updated via broadcast_refresh_later.
  • The import is resilient, handling vCards with irregular names or emails.
  • The import is atomic, meaning the entire process is reverted in case of failure.
  • Failed imports are flagged properly with a reason.
  • It's possible to see the last import and its skipped contacts. (nice to have)
  • We can undo imports, and related users are destroyed asynchronously. (nice to have)
  • Design components extracted directly from hey.com. (nice to have)

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.

2 participants