New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bugzilla55542 #898

Merged
merged 2 commits into from May 4, 2017

Conversation

Projects
None yet
4 participants
@rmarinho
Member

rmarinho commented May 3, 2017

Description of Change

This issue comes from January related with #674 , what happens is View was being cached with a null renderer.

Bugs Fixed

Behavioral Changes

We don't cache null renderers

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Rebased on top of master at time of PR
  • Changes adhere to coding standard
  • Consolidate commits as makes sense

@rmarinho rmarinho requested a review from hartez May 3, 2017

@@ -21,6 +21,9 @@ public class Registrar<TRegistrable> where TRegistrable : class
public void Register(Type tview, Type trender)
{
//avoid caching null renderers

This comment has been minimized.

@hartez

hartez May 3, 2017

Member

We do want to cache null renderer results if they're valid, so we don't have to do multiple GetCustomAttribute calls (see the comments in GetHandlerType.

It looks like what you really want is to avoid overwriting an existing handler with null; something like this:

if (trender == null && _handlers.ContainsKey(tview)) 
    return;

So if a handler has already been registered, don't overwrite it with 'null'; if there's no handler, we can cache the null result.

@hartez

hartez May 3, 2017

Member

We do want to cache null renderer results if they're valid, so we don't have to do multiple GetCustomAttribute calls (see the comments in GetHandlerType.

It looks like what you really want is to avoid overwriting an existing handler with null; something like this:

if (trender == null && _handlers.ContainsKey(tview)) 
    return;

So if a handler has already been registered, don't overwrite it with 'null'; if there's no handler, we can cache the null result.

This comment has been minimized.

@rmarinho

rmarinho May 3, 2017

Member

Yap crossed my mind that.. but decided null wasn't important .. will take your suggestion.

@rmarinho

rmarinho May 3, 2017

Member

Yap crossed my mind that.. but decided null wasn't important .. will take your suggestion.

This comment has been minimized.

@rmarinho

rmarinho May 3, 2017

Member

After further revision and discussion we found that the problem is with the lookup system that needs more work, and we will go with just reverting caching null for now

@rmarinho

rmarinho May 3, 2017

Member

After further revision and discussion we found that the problem is with the lookup system that needs more work, and we will go with just reverting caching null for now

This comment has been minimized.

@rmarinho

rmarinho May 3, 2017

Member

@hartez can you aprove?

@rmarinho

rmarinho May 3, 2017

Member

@hartez can you aprove?

@hartez

hartez approved these changes May 3, 2017

@rmarinho rmarinho merged commit 5518d3f into master May 4, 2017

8 checks passed

Android-UITests-C8 Finished TeamCity Build Xamarin.Forms :: Debug :: Stable - Cycle 9 :: UI Tests :: OSX Test Cloud Package - Run Android 6.0.1 : Tests passe…
Details
Android-UITests-LegacyRenderers Finished TeamCity Build Xamarin.Forms :: Debug :: Stable - Cycle 9 :: UI Tests :: OSX Test Cloud Package - Run Android 6.0.1 (Legacy Rende…
Details
OSX-Debug-C8 Finished TeamCity Build Xamarin.Forms :: Debug :: Stable - Cycle 9 :: OSX Debug : Running
Details
Windows-Debug-C8 Finished TeamCity Build Xamarin.Forms :: Debug :: Stable - Cycle 9 :: Windows Debug : Tests passed: 3783, ignored: 10
Details
Windows-Release Finished TeamCity Build Xamarin.Forms :: Debug :: Stable - Cycle 9 :: Windows Release Unit Tests : Tests passed: 3783, ignored: 10
Details
iOS10-UITests-C8 Finished TeamCity Build Xamarin.Forms :: Debug :: Stable - Cycle 9 :: UI Tests :: OSX Test Cloud Package - Run iOS Unified iOS10 : Tests p…
Details
iOS8-UITests-C8 Finished TeamCity Build Xamarin.Forms :: Debug :: Stable - Cycle 9 :: UI Tests :: OSX Test Cloud Package - Run iOS Unified IOS8 : Tests pa…
Details
iOS9-UITests-C8 Finished TeamCity Build Xamarin.Forms :: Debug :: Stable - Cycle 9 :: UI Tests :: OSX Test Cloud Package - Run iOS Unified iOS9 : Tests pa…
Details

@rmarinho rmarinho deleted the fix-bugzilla55542 branch May 4, 2017

rmarinho added a commit that referenced this pull request May 4, 2017

Fix bugzilla55542 (#898)
* [Controls] Add repo for bugzilla 55542

* [Core] Fix caching null renderer for ViewCell view

rmarinho added a commit that referenced this pull request May 4, 2017

Fix bugzilla55542 (#898)
* [Controls] Add repo for bugzilla 55542

* [Core] Fix caching null renderer for ViewCell view

assemhakmeh added a commit to assemhakmeh/Xamarin.Forms that referenced this pull request May 12, 2017

Merge branch '2.3.5' into ios-fastrenderers
* 2.3.5:
  [C] fix BP declaring Types for A11y (#913)
  [All] Rename Accessibility -> AutomationProperties (#912)
  Fix build
  [Core] Accessibility works with XamlC (#911)
  Fix bugzilla55542 (#898)
  [Android] Add null check before creating and drawing canvas bugzilla 55559 & 45602 (#899)
  Give layouts a chance to handle touch events after passing though immediate children (#902)
  Add disposed check on FastRenderer.VisualElemen... (#888)
  [Android] Add disposed check on FastRenderers.LabelRenderer (#886)
  add disposed check on FastRenderers.FrameRenderer (#887)
  [iOS] Null Element before disposing trial renderers in uneven ListViews (#894)
  [Xaml] move ValueConverterProvider to Core (#890)

@samhouts samhouts added D-15.4 and removed cla-already-signed labels Oct 10, 2017

@samhouts samhouts modified the milestones: 2.3.0, 2.3.4 Jun 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment