[Freeipa-devel] [PATCH] 009 Modifying sudo options refreshes the whole page

Petr Vobornik pvoborni at redhat.com
Mon Aug 29 12:58:06 UTC 2011


On 08/26/2011 11:04 PM, Endi Sukma Dewata wrote:
> On 8/26/2011 11:41 AM, Petr Vobornik wrote:
>> https://fedorahosted.org/freeipa/ticket/1689
>>
>> Currently adding or deleting sudo options will refresh the entire page.
>> It's not a problem but the code could be optimized to refresh only the
>> sudo options table
>
> We have several scenarios for sudo options:
>
> 1. Add succeeded: The command returns the new record, so we can use it
> to load the table. No problem here.
>
> 2. Add failed: We may be able to assume the data on the server didn't
> change, so we don't have to update the table. (Yes, the old code does a
> refresh, but I don't think it's necessary.)
In most cases it's true. One scenario, when update could be useful is 
when there is an network error while receiving response. But in this 
case updating the table would probably ended with the same error. 
Another case is when someone added the same option right before you.
>
> 3. Delete batch failed: I think we can assume nothing was executed, same
> as #2.
This time only some network issue can occur.
>
> 4. Delete batch succeeded: It could contain a mix of successes and
> failures. Like you said, we should use the last successful result.
>
> But instead of checking only the last result and do a load() or
> update(), we could iterate through the results and find the last
> successful one (the one with non-empty result).
Updated
>
> If we find one, then we can use it to load the table. If there isn't
> any, it means all failed, so we don't do anything, same as #2.
Same as 2 only for delete operation - you'll end with invalid table in 
concurrent deletion.
>
> What do you think?
>
Summary:
I would say that the network issue and the same concurrent edit issue 
can be so rare, that the update isn't much necessary and it slows down 
more frequent failures like non-concurrent adding of the same option.

If we want UI to be faster, we should removed updates. If we want it to 
be more valid in rare cases we should keep updates.

Included updated patches for both options (1-without updates, 2-with 
updates).

-- 
Petr Vobornik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pvoborni-0009-1-Modifying-sudo-options-refreshes-the-whole-page.patch
Type: text/x-patch
Size: 3117 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20110829/4f108faf/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pvoborni-0009-2-Modifying-sudo-options-refreshes-the-whole-page.patch
Type: text/x-patch
Size: 3787 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20110829/4f108faf/attachment-0001.bin>


More information about the Freeipa-devel mailing list