Closed Bug 1221594 Opened 9 years ago Closed 9 years ago

Create LoginsDetailViewController to display the details of a single login as well as options for editing/deleting

Categories

(Firefox for iOS :: General, defect)

Other
iOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
fxios 2.0+ ---

People

(Reporter: sleroux, Assigned: sleroux)

References

Details

(Whiteboard: [needstrings])

Attachments

(2 files)

When selecting a login from a list of logins, we want to display the details for that login including title, username, password, and url. Additionally, we want to include options for the user to edit the various login fields as well as delete the login. See attached screenshot for additional info.
Blocks: 1221595
Blocks: 1221688
Depends on: 1221693
No longer blocks: 1221688
Depends on: 1221688
No longer blocks: 1221595
Depends on: 1221595
Blocks: 1210103
No longer depends on: 1210103
Depends on: 1221709
Whiteboard: [needstrings]
Assignee: nobody → sleroux
Status: NEW → ASSIGNED
In the designs, we have a footer with the label 'Last modified XXXX' where XXX is the last modified timestamp. Looking at our logins code we have a LoginUsageData protocol with the following:

public protocol LoginUsageData {
    var timesUsed: Int { get set }
    var timeCreated: MicrosecondTimestamp { get set }
    var timeLastUsed: MicrosecondTimestamp { get set }
    var timePasswordChanged: MicrosecondTimestamp { get set }
}

Doesn't look like we capture last modified but we do know the last time the password was changed which is probably equally useful. One issue is that for local records this is always set to now. Is it possible to know the last time a local login's password was changed or maybe I'm looking at the wrong place? 

My WIP commit for this is here: https://github.com/mozilla/firefox-ios/commit/6a2e93a0fc82932886a1b20a1813593369be6345
Flags: needinfo?(rnewman)
Also, we should probably show an error dialog in the case the domain they modified the login to is invalid. I can land some basic copy today before the string freeze. Something like:

'Invalid website. Make sure that the website your login is for is a valid URL.'
Flags: needinfo?(sarentz)
Flags: needinfo?(randersen)
I wonder if we should also warn the user if they entered a blank username/password.
Clearing copy flags because editing will be handled as part of https://bugzilla.mozilla.org/show_bug.cgi?id=1221595
Flags: needinfo?(sarentz)
Flags: needinfo?(randersen)
Comment on attachment 8700734 [details] [review]
Link to Github pull-request: https://github.com/mozilla/firefox-ios/pull/1380

Fix the failing tests and we're good to go.
Attachment #8700734 - Flags: review?(etoop) → review+
Thanks for the quick review! I've fixed the tests and landed it.

master b9b53299f484fd91659c6ce10b6042cad600ecd3
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Going to reopen until dependency bugs are also finished.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(In reply to Stephan Leroux [:sleroux] from comment #1)

> Doesn't look like we capture last modified but we do know the last time the
> password was changed which is probably equally useful. One issue is that for
> local records this is always set to now. Is it possible to know the last
> time a local login's password was changed or maybe I'm looking at the wrong
> place?

The database stores both last modified (see LocalLogin) and time changed in loginsL. 

getUsageDataForLoginByGUID returns timePasswordChanged values for both local and remote records. updateLoginByGUID and addLogin both set timePasswordChanged correctly. The field is there and should be correct.

The only thing missing is populating the fields correctly in the Login instances when querying -- the search APIs (getLoginsForProtectionSpace, searchLoginsWithQuery, etc.) return LoginData instances rather than Logins, so those are stubbed out.
Flags: needinfo?(rnewman)
To clarify,

Local and remote logins have timePasswordChanged.
Local logins have local_modified when the login was last 'modified'

Some questions:

1. How come we have a modified timestamp only for local logins and not remote records?
2. Would using the timePasswordChange suffice for the 'Last Modifed: xxxx' label? This doesn't really mean 'last modified' though but if there is no way to know when a remote login was 'modified' I don't see what else we can do?
3. Depending on (1, 2), how would one bubble up the last modified time using a LoginData instance? Only thing I can think of is we'd have to modified the UNION ALL query to include rows that are not in both tables and do some massaging to map a column into something that makes sense for both. Again, this doesn't really make sense either since timePasswordChanged != lastModifed.
Flags: needinfo?(rnewman)
> 1. How come we have a modified timestamp only for local logins and not
> remote records?

Remote records have server_modified, which is a server clock value.

Local records have local_modified, which is a client clock values.

When a server record is locally modified, that password has *two* modification times: the timestamp of the last server record, and the timestamp of the last local modification that overlays the server record.

Those timestamps are used to reconcile conflicts.

Non-Sync code shouldn't be using *either* modification time -- they're not part of the value itself, and they don't appear in the Login object that frontend code gets to see.


> 2. Would using the timePasswordChange suffice for the 'Last Modifed: xxxx'
> label? This doesn't really mean 'last modified' though but if there is no
> way to know when a remote login was 'modified' I don't see what else we can
> do?

timePasswordChanged is the moment in time, from *a* client clock (not necessarily ours!), at which the password itself was changed.

It should always be later than or equal to timeCreated, and earlier than or equal to timeLastUsed.

timeLastUsed is optional.

You should use timePasswordChanged to indicate Last Modified.


> 3. Depending on (1, 2), how would one bubble up the last modified time using
> a LoginData instance?

Not last modified, time changed, but: most places that return LoginData should instead return Login, which is LoginData + LoginUsageData.
Flags: needinfo?(rnewman)
Resolved including password last modified fix.
Status: REOPENED → RESOLVED
Closed: 9 years ago9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: