IMGIITRoorkee / IMGIITRoorkee/placement-flutter

Handle string application values without crashing the profile list

Open
#55 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P2
Dominant language
Dart
Stars
3
Forks
10
Avg merge
8d 21h
Merged PRs (30d)
4

Description

Problem

The API returns application as an object, or as the string "not_applied", or as the string "exception" when the linked resume row has been deleted. The client stores the raw string and then calls .statusDisplayName or .resume.title on it, which throws NoSuchMethodError and takes down the whole list rather than one row.

The "exception" case is reachable in production: Application.resume is on_delete=SET_NULL, so deleting a resume puts a live application into that state.

Where

  • lib/models/profilesModel.dart:36-42 (the is String branch stores the raw string)
  • lib/viewmodels/ProfilesForMeViewModel.dart:35
  • lib/viewmodels/ProfilesForAllViewModel.dart:44
  • lib/viewmodels/ProfilesAppliedViewModel.dart:27
  • lib/views/ProfilesAppliedView.dart:69 (unguarded application.resume.title)
  • Backend source of the string: omniport-app-placement-and-internship/utils/get_application.py:31-32

Expected

A non-object application degrades to a readable status instead of crashing the list.

Fix sketch

  • Type the field as ApplicationModel? and populate it only when the JSON value is a Map.
  • Let the existing ?. and ?? handle the null case.
  • Fix all four call sites in the same pass, not just the one that was reported.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in lib/models/profilesModel.dart:36-42 and inspect how string versus object application values are stored. Then trace the four listed view-model and view call sites, including ProfilesAppliedView.dart:69, and verify that both "not_applied" and "exception" render a readable status without crashing the profile list.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.