I have a webservice with a mobile application. The user, with the application shares the data on the server - have a constraint in the DB that the name of the shared object is unique per user. Also application stores locally all created data (by the user - that is also shared).

I have the following scenario:

1. User creates data with data-name X.
2. User shares this data.
3. Server has in it DB data-name X for this user
4. User has a new phone and install the application.
5. NO INTERNET CONNECTION
6. user creates again data with data-name X.
7. it is stored only locally - since NO INTERNET CONNECTION.
8. Internet connection restored.
9. Now a BG service run and start sharing all u shared data - in the BG.
10. The problem found because of the constraint.

What should be done to solve the problem? I can popup a new window saying that it already shared and ask the user to rename/overwrite it, give option to D/L this data to its local DB etc. But since it is done in the BG - is it user-friendly to show this popup?

Any other ideas?

Probably there is a common way of doing it.

I can really use some help reagrding this issue.