Crash when we try to pass a query string to a POFile that doesn't exist yet.

Bug #44860 reported by Diogo Matsubara
6
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Critical
Данило Шеган

Bug Description

Steps to reproduce:
1. http://localhost:8086/distros/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/
2. Notice that French isn't listed, which means we don't have a POFile for it yet.
3. Manually change the URL to:
http://localhost:8086/distros/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/fr/+translate?alt=nb&show=untranslated
3. Crash like this: OOPS-133D157

Changed in rosetta:
assignee: nobody → carlos
Revision history for this message
Diogo Matsubara (matsubara) wrote :

<kiko-fud> I bet the problem is that dummypofile doesn't implement pofile.getPOTMsgSetTranslated pofile.getPOTMsgSetFuzzy or pofile.getPOTMsgSetUntranslated

<kiko-fud> the actual bug is DummyPOFile doesn't implement IPOFile even though it says it does.
<kiko-fud>so that would need to be fixed

Revision history for this message
Christian Reis (kiko) wrote :

When I say fixed I mean either:

a) Implementing the full IPOFile interface
b) Reducing the IPOFile interface, potentially by making some of the methods private
c) Changing from using IPOFile to something else.

The fact that this can be fixed with a band-aid shouldn't let us overlook the root of this problem.

Changed in rosetta:
status: Unconfirmed → Confirmed
Revision history for this message
Diogo Matsubara (matsubara) wrote : DummyPOFile says it implements IPOFile but it doesn't

Another way to reproduce a similar problem with the DummyPOFile.

Steps to reproduce (using sample data):
1.
http://localhost:8086/distros/ubuntu/hoary/+source/pmount/+pots/pmount/pt_BR/+translate
2. Selecte on 'Show:' select box 'untranslated' and click on Filter
3. Crash with a traceback like:
    * Module canonical.launchpad.browser.pofile, line 324, in initialize
      self.batchnav = BatchNavigator(
    * Module canonical.launchpad.browser.pofile, line 506, in getSelectedPOTMsgSet
      return pofile.getPOTMsgSetUntranslated()

AttributeError: 'DummyPOFile' object has no attribute 'getPOTMsgSetUntranslated'

Revision history for this message
Diogo Matsubara (matsubara) wrote :

OOPS-186D228 and OOPS-186B476 recent oopses

Changed in rosetta:
importance: Medium → High
Changed in rosetta:
assignee: carlos → danilo
Revision history for this message
Данило Шеган (danilo) wrote :

After discussion with SteveA, I was advised not to check if DummyPOFile implements full IPOFile interface.

So instead, I've added a test to check that none of the selections in a combo box is breaking (this test is going to be useful irregardless if the solution is actually considered fine).

For the fix, I just implemented three missing methods in DummyPOFile.

Revision history for this message
Carlos Perelló Marín (carlos) wrote :

Actually, what we should do is to split our interfaces to have a read only one and a write one.

DummyPOFile should implement the read only one and POFile both.

Of course, I'm not talking about doing that to solve this bug, just noting what we should plan to do in the future.

Changed in rosetta:
status: Confirmed → In Progress
Changed in rosetta:
importance: High → Critical
Changed in rosetta:
status: In Progress → Fix Committed
Changed in rosetta:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.